Class AttributePercentage
java.lang.Object
com.aquima.interactions.foundation.types.AbstractValue
com.aquima.interactions.foundation.types.NumberValue
com.aquima.interactions.foundation.types.Percentage
com.aquima.interactions.profile.model.value.AttributePercentage
- All Implemented Interfaces:
IConvertable
,IPrimitiveValue
,ISingleValue
,IValue
,Serializable
,Comparable<Object>
Profile value object for a percentage value.
This class is introduced to provide more information (attribute/instance) in case of a ConversionException.
- Since:
- 7.0
- Author:
- Jon van Leuven
- See Also:
-
Field Summary
Fields inherited from class com.aquima.interactions.foundation.types.Percentage
UNKNOWN
Fields inherited from class com.aquima.interactions.foundation.types.NumberValue
EQUALS_MARGIN
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AttributePercentage
(Percentage delegateValue, ValueReference reference) Construct an attribute value based on a value and an attribute reference. -
Method Summary
Modifier and TypeMethodDescriptionboolean
This method converts the internal value to a boolean primitive.This method converts the internal value to a date object.double
This method converts the internal value to a double primitive.int
This method converts the internal value to an integer primitive.long
This method converts the internal value to a long primitive.This method converts the internal value to a String object.This method will attempt to convert the value to a range value.This method will attempt to convert the value to a single value.Methods inherited from class com.aquima.interactions.foundation.types.Percentage
forType, getDataType, parsePercentage, toString, valueOf
Methods inherited from class com.aquima.interactions.foundation.types.NumberValue
compareSimple, contains, doubleCompare, duplicate, equals, getValue, hashCode, isUnknown, parseDouble
Methods inherited from class com.aquima.interactions.foundation.types.AbstractValue
compareTo, getDisplayValue, getTypeName, isRangeValue, isSingleValue, toListValue
-
Constructor Details
-
AttributePercentage
Construct an attribute value based on a value and an attribute reference.- Parameters:
delegateValue
- The original value.reference
- The reference to the attribute of an instance that has this value.
-
-
Method Details
-
booleanValue
public boolean booleanValue()Description copied from interface:IConvertable
This method converts the internal value to a boolean primitive.- Specified by:
booleanValue
in interfaceIConvertable
- Overrides:
booleanValue
in classNumberValue
- Returns:
- Boolean primitive of the internal value.
-
dateValue
Description copied from interface:IConvertable
This method converts the internal value to a date object.- Specified by:
dateValue
in interfaceIConvertable
- Overrides:
dateValue
in classNumberValue
- Returns:
- Date object of the internal value.
-
doubleValue
public double doubleValue()Description copied from interface:IConvertable
This method converts the internal value to a double primitive.- Specified by:
doubleValue
in interfaceIConvertable
- Overrides:
doubleValue
in classNumberValue
- Returns:
- Double primitive of the internal value.
-
integerValue
public int integerValue()Description copied from interface:IConvertable
This method converts the internal value to an integer primitive.- Specified by:
integerValue
in interfaceIConvertable
- Overrides:
integerValue
in classNumberValue
- Returns:
- Integer primitive of the internal value.
-
longValue
public long longValue()Description copied from interface:IConvertable
This method converts the internal value to a long primitive.- Specified by:
longValue
in interfaceIConvertable
- Overrides:
longValue
in classNumberValue
- Returns:
- Long primitive of the internal value.
-
stringValue
Description copied from interface:IConvertable
This method converts the internal value to a String object.- Specified by:
stringValue
in interfaceIConvertable
- Overrides:
stringValue
in classNumberValue
- Returns:
- String object of the internal value.
-
toRangeValue
Description copied from interface:IValue
This method will attempt to convert the value to a range value. The conversion might fail and raise an exception when the value this method is called on is either a list value. The method isRangeValue can be used to determine if this value can safely be converted to a range value. When the value this method is called on already implements the IRangeValue interface, the implementation may return the same value.- Specified by:
toRangeValue
in interfaceIValue
- Overrides:
toRangeValue
in classAbstractValue
- Returns:
- The same value as a range value.
-
toSingleValue
Description copied from interface:IValue
This method will attempt to convert the value to a single value. The conversion might fail and raise an exception when the value this method is called on is either a range or a list value. The method isSingleValue can be used to determine if this value can safely be converted to a single value. When the value this method is called on already implements the ISingleValue interface, the implementation may return the same value.- Specified by:
toSingleValue
in interfaceIValue
- Overrides:
toSingleValue
in classAbstractValue
- Returns:
- The same value as single value.
-