Package io.dialob.rule.parser.api
Enum PrimitiveValueType
- java.lang.Object
-
- java.lang.Enum<PrimitiveValueType>
-
- io.dialob.rule.parser.api.PrimitiveValueType
-
- All Implemented Interfaces:
ValueType,Serializable,Comparable<PrimitiveValueType>
public enum PrimitiveValueType extends Enum<PrimitiveValueType> implements ValueType
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanEqualWith(ValueType rhs)booleancanOrderWith(ValueType rhs)ValueTypedivideByType(ValueType rhs)StringgetName()bytegetTypeCode()booleanisPrimitive()ValueTypeminusType(ValueType rhs)ValueTypemultiplyType(ValueType rhs)<T> BinaryOperator<T>multOp()Objectnegate(Object value)Objectnot(Object value)ObjectparseFromStringWithUnit(String value, String unit)ValueTypeplusType(ValueType rhs)<T> BinaryOperator<T>sumOp()static PrimitiveValueTypevalueOf(String name)Returns the enum constant of this type with the specified name.static PrimitiveValueType[]values()Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface io.dialob.rule.parser.api.ValueType
coerseFrom, getComparator, getItemValueType, getTypeClass, isArray, isNegateable, parseFromString, readFrom, writeTo
-
-
-
-
Enum Constant Detail
-
TIME
public static final PrimitiveValueType TIME
-
DURATION
public static final PrimitiveValueType DURATION
-
DATE
public static final PrimitiveValueType DATE
-
PERIOD
public static final PrimitiveValueType PERIOD
-
INTEGER
public static final PrimitiveValueType INTEGER
-
DECIMAL
public static final PrimitiveValueType DECIMAL
-
BOOLEAN
public static final PrimitiveValueType BOOLEAN
-
STRING
public static final PrimitiveValueType STRING
-
PERCENT
public static final PrimitiveValueType PERCENT
-
-
Method Detail
-
values
public static PrimitiveValueType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (PrimitiveValueType c : PrimitiveValueType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PrimitiveValueType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
isPrimitive
public boolean isPrimitive()
- Specified by:
isPrimitivein interfaceValueType
-
sumOp
public <T> BinaryOperator<T> sumOp()
-
multOp
public <T> BinaryOperator<T> multOp()
-
multiplyType
public ValueType multiplyType(ValueType rhs)
- Specified by:
multiplyTypein interfaceValueType
-
divideByType
public ValueType divideByType(ValueType rhs)
- Specified by:
divideByTypein interfaceValueType
-
canEqualWith
public boolean canEqualWith(ValueType rhs)
- Specified by:
canEqualWithin interfaceValueType
-
canOrderWith
public boolean canOrderWith(ValueType rhs)
- Specified by:
canOrderWithin interfaceValueType
-
parseFromStringWithUnit
public Object parseFromStringWithUnit(String value, String unit)
- Specified by:
parseFromStringWithUnitin interfaceValueType
-
getTypeCode
public byte getTypeCode()
- Specified by:
getTypeCodein interfaceValueType
-
-