Module jpastreamer.field
Package com.speedment.jpastreamer.field
Interface EnumField<ENTITY,E extends Enum<E>>
- All Superinterfaces:
ComparableField<ENTITY,,E> Comparator<ENTITY>,com.speedment.runtime.compute.expression.Expression<ENTITY>,Field<ENTITY>,Function<ENTITY,,E> HasColumnName,HasComparableOperators<ENTITY,,E> com.speedment.runtime.compute.trait.HasCompare<ENTITY>,com.speedment.runtime.compute.trait.HasCompose<ENTITY>,HasGetter<ENTITY>,com.speedment.runtime.compute.trait.HasHash<ENTITY>,com.speedment.runtime.compute.trait.HasMapIfPresent<ENTITY,,UnaryOperator<E>, com.speedment.runtime.compute.ToEnumNullable<ENTITY, E>> com.speedment.runtime.compute.trait.HasMapToDoubleIfPresent<ENTITY,,ToDoubleFunction<E>> HasReferenceOperators<ENTITY>,HasReferenceValue<ENTITY,,E> HasTable<ENTITY>,ReferenceField<ENTITY,,E> com.speedment.runtime.compute.ToEnumNullable<ENTITY,,E> com.speedment.runtime.compute.trait.ToNullable<ENTITY,E, com.speedment.runtime.compute.ToEnum<ENTITY, E>>
public interface EnumField<ENTITY,E extends Enum<E>>
extends ComparableField<ENTITY,E>, com.speedment.runtime.compute.ToEnumNullable<ENTITY,E>
A field representing an
Enum value in the entity.- Since:
- 3.0.10
- Author:
- Emil Forslund
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault EReturns the set of possible values for this enum.create(Class<ENTITY> table, String columnName, ReferenceGetter<ENTITY, E> getter, Class<E> enumClass) Create a new instance of this interface using the default implementation.Returns the enum class of this field.default FieldIsNotNullPredicate<ENTITY,E> isNull()default com.speedment.runtime.compute.ToDoubleNullable<ENTITY>mapToDoubleIfPresent(ToDoubleFunction<E> mapper) Returns anToDoubleNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.Methods inherited from interface java.util.Comparator
equalsMethods inherited from interface com.speedment.jpastreamer.field.trait.HasColumnName
columnNameMethods inherited from interface com.speedment.jpastreamer.field.trait.HasComparableOperators
between, between, comparator, comparatorNullFieldsFirst, equal, greaterOrEqual, greaterThan, in, in, lessOrEqual, lessThan, notBetween, notBetween, notEqual, notIn, notIn, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongMethods inherited from interface com.speedment.jpastreamer.field.trait.HasReferenceValue
get, getterMethods inherited from interface com.speedment.jpastreamer.field.ReferenceField
asBigDecimal, asBoolean, asByte, asChar, asDouble, asEnum, asFloat, asInt, asLong, asShort, asString, mapToBigDecimalIfPresent, mapToBooleanIfPresent, mapToByteIfPresent, mapToCharIfPresent, mapToEnumIfPresent, mapToFloatIfPresent, mapToIntIfPresent, mapToLongIfPresent, mapToShortIfPresent, mapToStringIfPresentMethods inherited from interface com.speedment.runtime.compute.ToEnumNullable
asName, asOrdinal, compare, compose, expressionType, hash, mapIfPresent, orElse, orElseGet, orThrowMethods inherited from interface com.speedment.runtime.compute.trait.ToNullable
isNotNull, isNull
-
Method Details
-
enumClass
Returns the enum class of this field. -
constants
Returns the set of possible values for this enum. The order will be the ordinal order of the enum.This method creates a copy of the internal storage structure so changes to the returned collection are allowed.
- Returns:
- the constants
-
isNull
FieldIsNullPredicate<ENTITY,E> isNull()Description copied from interface:HasReferenceOperators- Specified by:
isNullin interfaceHasReferenceOperators<ENTITY>- Specified by:
isNullin interfacecom.speedment.runtime.compute.trait.ToNullable<ENTITY,E extends Enum<E>, com.speedment.runtime.compute.ToEnum<ENTITY, E extends Enum<E>>> - Returns:
- a Predicate that will evaluate to
true, if and only if this Field isnull
-
isNotNull
Description copied from interface:HasReferenceOperators- Specified by:
isNotNullin interfaceHasReferenceOperators<ENTITY>- Specified by:
isNotNullin interfacecom.speedment.runtime.compute.trait.ToNullable<ENTITY,E extends Enum<E>, com.speedment.runtime.compute.ToEnum<ENTITY, E extends Enum<E>>> - Returns:
- a Predicate that will evaluate to
true, if and only if this Field is notnull
-
apply
-
mapToDoubleIfPresent
default com.speedment.runtime.compute.ToDoubleNullable<ENTITY> mapToDoubleIfPresent(ToDoubleFunction<E> mapper) Description copied from interface:ReferenceFieldReturns anToDoubleNullableexpression that has the value returned by the specified mapper function if the value for this field is notnull, and otherwisenull.- Specified by:
mapToDoubleIfPresentin interfacecom.speedment.runtime.compute.trait.HasMapToDoubleIfPresent<ENTITY,E extends Enum<E>> - Specified by:
mapToDoubleIfPresentin interfaceReferenceField<ENTITY,E extends Enum<E>> - Specified by:
mapToDoubleIfPresentin interfacecom.speedment.runtime.compute.ToEnumNullable<ENTITY,E extends Enum<E>> - Parameters:
mapper- the mapper operation- Returns:
- expression for this value after mapper has been applied
-
create
static <ENTITY,E extends Enum<E>> EnumField<ENTITY,E> create(Class<ENTITY> table, String columnName, ReferenceGetter<ENTITY, E> getter, Class<E> enumClass) Create a new instance of this interface using the default implementation.- Type Parameters:
ENTITY- the entity typeE- the java enum type- Parameters:
table- the table that this field belongs tocolumnName- the name of the database column the field representsgetter- method reference to the getter in the entityenumClass- the enum class- Returns:
- the created field
-