public interface EnumField<ENTITY,D,E extends Enum<E>> extends ComparableField<ENTITY,D,E>, HasStringOperators<ENTITY,D>
Enum
value in the entity.ComparableField
Modifier and Type | Method and Description |
---|---|
default Predicate<ENTITY> |
between(String start,
String end)
Returns a new predicate that evaluates if entities has a enum value for
this field with a value that is between the two specified values.
|
Predicate<ENTITY> |
between(String start,
String end,
Inclusion inclusion)
Returns a new predicate that evaluates if entities has a enum value for
this field with a value that is between the two specified values.
|
EnumSet<E> |
constants()
Returns the set of possible values for this enum.
|
static <ENTITY,D,E extends Enum<E>> |
create(ColumnIdentifier<ENTITY> identifier,
ReferenceGetter<ENTITY,E> getter,
ReferenceSetter<ENTITY,E> setter,
TypeMapper<D,E> typeMapper,
Function<E,String> enumToString,
Function<String,E> stringToEnum,
Class<E> enumClass)
Create a new instance of this interface using the default implementation.
|
Class<E> |
enumClass()
Returns the enum class of this field.
|
Function<E,String> |
enumToString()
A method that takes an enum and converts it into a
String . |
Predicate<ENTITY> |
equal(String value)
Returns a new predicate that evaluates if entities has a enum value for
this field with a value that is equal to the specified value.
|
Predicate<ENTITY> |
greaterOrEqual(String value)
Returns a new predicate that evaluates if entities has a enum value for
this field with a value that is greater or equal to the specified value.
|
Predicate<ENTITY> |
greaterThan(String value)
Returns a new predicate that evaluates if entities has a enum value for
this field with a value that is greater than the specified value.
|
Predicate<ENTITY> |
lessOrEqual(String value)
Returns a new predicate that evaluates if entities has a enum value for
this field with a value that is less or equal to the specified value.
|
Predicate<ENTITY> |
lessThan(String value)
Returns a new predicate that evaluates if entities has a enum value for
this field with a value that is less than the specified value.
|
default Predicate<ENTITY> |
notBetween(String start,
String end)
Returns a new predicate that evaluates if entities has a enum value for
this field with a value that is not between the two specified values.
|
Predicate<ENTITY> |
notBetween(String start,
String end,
Inclusion inclusion)
Returns a new predicate that evaluates if entities has a enum value for
this field with a value that is not between the two specified values.
|
Predicate<ENTITY> |
notEqual(String value)
Returns a new predicate that evaluates if entities has a enum value for
this field with a value that is not equal to the specified value.
|
Function<String,E> |
stringToEnum()
A method that takes a
String and converts it into an enum for
this field. |
create
isNotNull, isNull
get, getter, set, setter, setTo, typeMapper
findColumn, identifier
between, between, comparator, comparatorNullFieldsFirst, comparatorNullFieldsLast, equal, greaterOrEqual, greaterThan, in, in, lessOrEqual, lessThan, notBetween, notBetween, notEqual, notIn, notIn
contains, containsIgnoreCase, endsWith, endsWithIgnoreCase, equalIgnoreCase, isEmpty, isNotEmpty, notContains, notContainsIgnoreCase, notEndsWith, notEndsWithIgnoreCase, notEqualIgnoreCase, notStartsWith, notStartsWithIgnoreCase, startsWith, startsWithIgnoreCase
Class<E> enumClass()
EnumSet<E> constants()
This method creates a copy of the internal storage structure so changes to the returned collection are allowed.
Function<String,E> stringToEnum()
String
and converts it into an enum for
this field.
The function should return null
if a null
value is
specified as input and throw an exception if the value is invalid.
Function<E,String> enumToString()
String
.
The function should return null
if a null
value is
specified as input and throw an exception if the value is invalid.
Predicate<ENTITY> equal(String value)
enumToString()
-method.value
- the argumentPredicate<ENTITY> notEqual(String value)
enumToString()
-method.value
- the argumentPredicate<ENTITY> lessThan(String value)
enumToString()
-method.value
- the argumentPredicate<ENTITY> lessOrEqual(String value)
enumToString()
-method.value
- the argumentPredicate<ENTITY> greaterThan(String value)
enumToString()
-method.value
- the argumentPredicate<ENTITY> greaterOrEqual(String value)
enumToString()
-method.value
- the argumentdefault Predicate<ENTITY> between(String start, String end)
enumToString()
-method.start
- the start (inclusive)end
- the end (exclusive)Predicate<ENTITY> between(String start, String end, Inclusion inclusion)
enumToString()
-method.start
- the startend
- the endinclusion
- if start and end are inclusive or exclusivedefault Predicate<ENTITY> notBetween(String start, String end)
enumToString()
-method.start
- the start (inclusive)end
- the end (exclusive)Predicate<ENTITY> notBetween(String start, String end, Inclusion inclusion)
enumToString()
-method.start
- the startend
- the endinclusion
- if start and end are inclusive or exclusivestatic <ENTITY,D,E extends Enum<E>> EnumField<ENTITY,D,E> create(ColumnIdentifier<ENTITY> identifier, ReferenceGetter<ENTITY,E> getter, ReferenceSetter<ENTITY,E> setter, TypeMapper<D,E> typeMapper, Function<E,String> enumToString, Function<String,E> stringToEnum, Class<E> enumClass)
ENTITY
- the entity typeD
- the database typeE
- the java enum typeidentifier
- the column that this field representsgetter
- method reference to the getter in the entitysetter
- method reference to the setter in the entitytypeMapper
- the type mapper that is appliedenumToString
- method to convert enum to a stringstringToEnum
- method to convert a string to enumenumClass
- the enum classCopyright © 2017 Speedment, Inc.. All rights reserved.