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 int
Deprecated.static final int
static final int
static final StringFieldMinimumLength
Deprecated.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.int
int
com.exedio.cope.SelectType<String>
hashDoesNotMatch
(String algorithm, DataField data) Deprecated.UsehashDoesNotMatchIfSupported(String, DataField)
instead.hashDoesNotMatchIfSupported
(String algorithm, DataField data) The result may cause anUnsupportedQueryException
when used, if the field is stored in avault
, or thealgorithm
is not supported by the database.hashMatches
(String algorithm, DataField data) Deprecated.UsehashMatchesIfSupported(String, DataField)
instead.hashMatchesIfSupported
(String algorithm, DataField data) The result may cause anUnsupportedQueryException
when used, if the field is stored in avault
, or thealgorithm
is 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 nocopyFrom
fields 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, set
Methods inherited from class com.exedio.cope.Field
castCollection, check, execute, getColumnName, getInitialType, getPatterns, getValueClass, isFinal, isMandatory, mapNull
Methods inherited from class com.exedio.cope.Feature
afterModelCreated, getAbstractType, getAnnotation, getID, getLocalizationKeys, getName, getPattern, getType, isAnnotationPresent, isSourceAlready, mount, readResolve, requireMounted, toString, toString, writeReplace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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, notEqual
Methods inherited from interface com.exedio.cope.Selectable
append, appendSelect, check, getType, getValueClass, toString
Methods 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_LENGTH
instead- See Also:
-
-
Constructor Details
-
StringField
-
StringField
public StringField()Creates a new mandatoryStringField
.
-
-
Method Details
-
copy
- Specified by:
copy
in classFunctionField<String>
-
toFinal
Description copied from class:Field
Returns 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:
toFinal
in classFunctionField<String>
- See Also:
-
optional
Description copied from class:Field
Returns 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:
optional
in classFunctionField<String>
- See Also:
-
unique
Description copied from class:FunctionField
Returns 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:
unique
in classFunctionField<String>
- See Also:
-
nonUnique
- Specified by:
nonUnique
in classFunctionField<String>
-
copyFrom
- Specified by:
copyFrom
in classFunctionField<String>
- See Also:
-
noCopyFrom
Description copied from class:FunctionField
Returns a new FunctionField that differs from this FunctionField by having nocopyFrom
fields set.- Specified by:
noCopyFrom
in classFunctionField<String>
-
noDefault
- Specified by:
noDefault
in classFunctionField<String>
-
defaultTo
- Specified by:
defaultTo
in classFunctionField<String>
-
lengthRange
-
lengthMin
-
lengthMax
-
lengthExact
-
charSet
-
getMinimumLength
public int getMinimumLength() -
getMaximumLength
public int getMaximumLength() -
getCharSet
-
getInitialExceptions
Description copied from interface:Settable
Returns the exceptions possibly thrown, when setting a value for this settable.- Specified by:
getInitialExceptions
in interfaceSettable<String>
- Overrides:
getInitialExceptions
in classFunctionField<String>
-
getValueType
- Specified by:
getValueType
in interfaceSelectable<String>
-
hashMatchesIfSupported
@Nonnull public Condition hashMatchesIfSupported(@Nonnull String algorithm, @Nonnull DataField data) The result may cause anUnsupportedQueryException
when used, if the field is stored in avault
, or thealgorithm
is 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 anUnsupportedQueryException
when used, if the field is stored in avault
, or thealgorithm
is 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_LENGTH
instead