Package org.apache.cayenne.access.types
Class BigDecimalValueType
- java.lang.Object
-
- org.apache.cayenne.access.types.BigDecimalValueType
-
- All Implemented Interfaces:
ValueObjectType<BigDecimal,BigDecimal>
public class BigDecimalValueType extends Object implements ValueObjectType<BigDecimal,BigDecimal>
- Since:
- 4.2
-
-
Constructor Summary
Constructors Constructor Description BigDecimalValueType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(BigDecimal value1, BigDecimal value2)Allows to use special logic to compare values for equality as in rare cases it is not suffice to use default equals() method.BigDecimalfromJavaObject(BigDecimal object)Class<BigDecimal>getTargetType()Class<BigDecimal>getValueType()StringtoCacheKey(BigDecimal object)Returned value should be same for objects that is logically equal.BigDecimaltoJavaObject(BigDecimal value)
-
-
-
Method Detail
-
getTargetType
public Class<BigDecimal> getTargetType()
- Specified by:
getTargetTypein interfaceValueObjectType<BigDecimal,BigDecimal>- Returns:
- base type used to serialize V objects to.
-
getValueType
public Class<BigDecimal> getValueType()
- Specified by:
getValueTypein interfaceValueObjectType<BigDecimal,BigDecimal>- Returns:
- type of Objects described by this ValueObjectType.
-
toJavaObject
public BigDecimal toJavaObject(BigDecimal value)
- Specified by:
toJavaObjectin interfaceValueObjectType<BigDecimal,BigDecimal>- Parameters:
value- of type T- Returns:
- java object
-
fromJavaObject
public BigDecimal fromJavaObject(BigDecimal object)
- Specified by:
fromJavaObjectin interfaceValueObjectType<BigDecimal,BigDecimal>- Parameters:
object- java object- Returns:
- value of type T
-
toCacheKey
public String toCacheKey(BigDecimal object)
Description copied from interface:ValueObjectTypeReturned value should be same for objects that is logically equal.- Specified by:
toCacheKeyin interfaceValueObjectType<BigDecimal,BigDecimal>- Returns:
- String representation usable for cache.
-
equals
public boolean equals(BigDecimal value1, BigDecimal value2)
Description copied from interface:ValueObjectTypeAllows to use special logic to compare values for equality as in rare cases it is not suffice to use default equals() method. Default implementation usesObjects.equals(Object, Object)method.- Specified by:
equalsin interfaceValueObjectType<BigDecimal,BigDecimal>- Parameters:
value1- to comparevalue2- to compare- Returns:
- true if given values are equal
-
-