Package com.exedio.cope
Class StringField
- All Implemented Interfaces:
Copyable,Function<String>,Selectable<String>,Settable<String>,StringFunction,Serializable
Represents a field within a
type,
that enables instances of that type to store a string.- Author:
- Ralf Wiebicke
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated.static final intstatic final intstatic final StringFieldMinimumLengthDeprecated.Check carefully, if empty string should really be allowed. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new mandatoryStringField.StringField(StringFieldMinimumLength minimumLength) -
Method Summary
Modifier and TypeMethodDescriptioncharacterSet(CharacterSet characterSet) Deprecated.UsecharSet(CharSet)insteadcopy()Deprecated.UsegetCharSet()insteadReturns the exceptions possibly thrown, when setting a value for this settable.intintcom.exedio.cope.SelectType<String>hashDoesNotMatch(String algorithm, DataField data) Deprecated.UsehashDoesNotMatchIfSupported(String, DataField)instead.hashDoesNotMatchIfSupported(String algorithm, DataField data) The result may cause anUnsupportedQueryExceptionwhen used, if the field is stored in avault, or thealgorithmis not supported by the database.hashMatches(String algorithm, DataField data) Deprecated.UsehashMatchesIfSupported(String, DataField)instead.hashMatchesIfSupported(String algorithm, DataField data) The result may cause anUnsupportedQueryExceptionwhen used, if the field is stored in avault, or thealgorithmis not supported by the database.lengthExact(int exactLength) lengthMax(int maximumLength) lengthMaxUnchecked(int maximumLength) Deprecated.uselengthMax(int).lengthMin(int minimumLength) lengthRange(int minimumLength, int maximumLength) Returns a new FunctionField that differs from this FunctionField by having nocopyFromfields set.optional()Returns a new Field, that differs from this Field by being optional.toFinal()Returns a new Field, that differs from this Field by being final.unique()Returns a new FunctionField, that differs from this FunctionField by being unique.Deprecated.renamed toStringFunction.toUpperCase()Methods inherited from class com.exedio.cope.FunctionField
addCopyFrom, append, appendSelect, check, copy, copyFunctionField, get, get, getDefaultConstant, getImplicitCopyConstraint, getImplicitCopyConstraints, getImplicitUniqueConstraint, getUniqueConstraints, hasDefault, isInitial, isRedundantByCopyConstraint, searchUnique, searchUnique, searchUniqueStrict, setMethods inherited from class com.exedio.cope.Field
castCollection, check, execute, getColumnName, getInitialType, getPatterns, getValueClass, isFinal, isMandatory, mapNullMethods inherited from class com.exedio.cope.Feature
afterModelCreated, getAbstractType, getAnnotation, getID, getLocalizationKeys, getName, getPattern, getType, isAnnotationPresent, isSourceAlready, mount, readResolve, requireMounted, toString, toString, writeReplaceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.exedio.cope.Function
any, between, equal, equal, equal, get, get, greater, greater, greaterOrEqual, greaterOrEqual, in, in, isNotNull, isNull, less, less, lessOrEqual, lessOrEqual, max, min, notEqual, notEqualMethods inherited from interface com.exedio.cope.Selectable
append, appendSelect, check, getType, getValueClass, toStringMethods inherited from interface com.exedio.cope.StringFunction
bind, contains, containsIgnoreCase, endsWith, endsWithIgnoreCase, equalIgnoreCase, length, like, likeIgnoreCase, startsWith, startsWithIgnoreCase, toUpperCase
-
Field Details
-
DEFAULT_MINIMUM_LENGTH
public static final int DEFAULT_MINIMUM_LENGTH- See Also:
-
DEFAULT_MAXIMUM_LENGTH
public static final int DEFAULT_MAXIMUM_LENGTH- See Also:
-
EMPTY
Deprecated.Check carefully, if empty string should really be allowed. If yes, uselengthMin(0)instead. -
DEFAULT_LENGTH
Deprecated.UseDEFAULT_MAXIMUM_LENGTHinstead- See Also:
-
-
Constructor Details
-
StringField
-
StringField
public StringField()Creates a new mandatoryStringField.
-
-
Method Details
-
copy
- Specified by:
copyin classFunctionField<String>
-
toFinal
Description copied from class:FieldReturns a new Field, that differs from this Field by being final. If this Field is already final, the the result is equal to this Field.- Specified by:
toFinalin classFunctionField<String>- See Also:
-
optional
Description copied from class:FieldReturns a new Field, that differs from this Field by being optional. If this Field is already optional, the the result is equal to this Field.- Specified by:
optionalin classFunctionField<String>- See Also:
-
unique
Description copied from class:FunctionFieldReturns a new FunctionField, that differs from this FunctionField by being unique. If this FunctionField is already unique, the the result is equal to this FunctionField.- Specified by:
uniquein classFunctionField<String>- See Also:
-
nonUnique
- Specified by:
nonUniquein classFunctionField<String>
-
copyFrom
- Specified by:
copyFromin classFunctionField<String>- See Also:
-
noCopyFrom
Description copied from class:FunctionFieldReturns a new FunctionField that differs from this FunctionField by having nocopyFromfields set.- Specified by:
noCopyFromin classFunctionField<String>
-
noDefault
- Specified by:
noDefaultin classFunctionField<String>
-
defaultTo
- Specified by:
defaultToin classFunctionField<String>
-
lengthRange
-
lengthMin
-
lengthMax
-
lengthExact
-
charSet
-
getMinimumLength
public int getMinimumLength() -
getMaximumLength
public int getMaximumLength() -
getCharSet
-
getInitialExceptions
Description copied from interface:SettableReturns the exceptions possibly thrown, when setting a value for this settable.- Specified by:
getInitialExceptionsin interfaceSettable<String>- Overrides:
getInitialExceptionsin classFunctionField<String>
-
getValueType
- Specified by:
getValueTypein interfaceSelectable<String>
-
hashMatchesIfSupported
@Nonnull public Condition hashMatchesIfSupported(@Nonnull String algorithm, @Nonnull DataField data) The result may cause anUnsupportedQueryExceptionwhen used, if the field is stored in avault, or thealgorithmis not supported by the database.- Parameters:
algorithm- seeModel.getSupportedDataHashAlgorithms()- See Also:
-
hashDoesNotMatchIfSupported
@Nonnull public Condition hashDoesNotMatchIfSupported(@Nonnull String algorithm, @Nonnull DataField data) The result may cause anUnsupportedQueryExceptionwhen used, if the field is stored in avault, or thealgorithmis not supported by the database. -
hashMatches
@Deprecated @Nonnull public Condition hashMatches(@Nonnull String algorithm, @Nonnull DataField data) Deprecated.UsehashMatchesIfSupported(String, DataField)instead. -
hashDoesNotMatch
@Deprecated @Nonnull public Condition hashDoesNotMatch(@Nonnull String algorithm, @Nonnull DataField data) Deprecated.UsehashDoesNotMatchIfSupported(String, DataField)instead. -
lengthMaxUnchecked
Deprecated.uselengthMax(int). -
uppercase
Deprecated.renamed toStringFunction.toUpperCase() -
characterSet
Deprecated.UsecharSet(CharSet)instead -
getCharacterSet
Deprecated.UsegetCharSet()instead
-
DEFAULT_MAXIMUM_LENGTHinstead