Package ru.sergkorot.dynamic.model.enums
Enum Class ValueType
- All Implemented Interfaces:
Serializable,Comparable<ValueType>,Constable
- Author:
- Sergey Korotaev Enum which has types for casts When an object comes in a request, its type is determined and the collection or the object itself is cast into its type for searching
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionElement of enum for casting object to the boolean typeElement of enum for casting object to the instant typeElement of enum for casting object to the double typeElement of enum for casting object to the long typeElement of enum for casting object to the string type -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectStatic method that is called on an object to determine its type and cast to the appropriate typeabstract Collection<?>castCollection(Object obj) Method that casts the entire collection to the desired typeabstract <U> BooleancheckValueType(U u) Method that checks the type of the incoming object for further filtering by conditionstatic Collection<?>collectionCast(Object value) A static method that is called on a collection to determining the types of elements in the collection and casting the collection to the appropriate typeabstract ObjectsimpleCast(Object obj) Method that casts an object to the desired typestatic ValueTypeReturns the enum constant of this class with the specified name.static ValueType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
STRING_VARIABLE
Element of enum for casting object to the string type -
LONG_VARIABLE
Element of enum for casting object to the long type -
DOUBLE_VARIABLE
Element of enum for casting object to the double type -
BOOLEAN_VARIABLE
Element of enum for casting object to the boolean type -
DATETIME_VARIABLE
Element of enum for casting object to the instant type
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
checkValueType
Method that checks the type of the incoming object for further filtering by condition- Type Parameters:
U- - generic by incoming object- Parameters:
u- - an object whose type is determined for further insertion- Returns:
- - true/false depending on the condition
-
castCollection
Method that casts the entire collection to the desired type- Parameters:
obj- - an object, which is then parsed into a collection of the desired type- Returns:
- - collection of the desired type
-
simpleCast
Method that casts an object to the desired type- Parameters:
obj- - object, which is then cast to the desired type- Returns:
- - Object of the desired type
-
cast
Static method that is called on an object to determine its type and cast to the appropriate type- Parameters:
value- - incoming object- Returns:
- - Object of the desired type
-
collectionCast
A static method that is called on a collection to determining the types of elements in the collection and casting the collection to the appropriate type- Parameters:
value- - incoming collection as an object- Returns:
- - collection of the desired type
-