org.fudgemsg.types.secondary
Class JavaMathBigDecimalFieldType
java.lang.Object
org.fudgemsg.FudgeFieldType<SecondaryType>
org.fudgemsg.types.SecondaryFieldTypeBase<SecondaryType,PrimitiveType,PrimitiveType>
org.fudgemsg.types.SecondaryFieldType<BigDecimal,String>
org.fudgemsg.types.secondary.JavaMathBigDecimalFieldType
- All Implemented Interfaces:
- Serializable, FudgeTypeConverter<String,BigDecimal>
public class JavaMathBigDecimalFieldType
- extends SecondaryFieldType<BigDecimal,String>
Secondary type for BigDecimal conversion to/from String.
- See Also:
- Serialized Form
INSTANCE
public static final JavaMathBigDecimalFieldType INSTANCE
- Singleton instance of the type.
secondaryToPrimary
public String secondaryToPrimary(BigDecimal object)
- Description copied from class:
SecondaryFieldTypeBase
- Converts an object from the secondary type to a primitive Fudge type for writing. An implementation
may assume that the
object
parameter is not null
.
- Specified by:
secondaryToPrimary
in class SecondaryFieldTypeBase<BigDecimal,String,String>
- Parameters:
object
- the secondary instance
- Returns:
- the underlying Fudge data to write out
primaryToSecondary
public BigDecimal primaryToSecondary(String data)
- Description copied from class:
SecondaryFieldType
- Converts Fudge primitive data to the secondary type. This is an optional operation - it will only be
invoked if the user attempts to convert from the underlying type used for transport back to the
secondary type. An implementation may assume that the
object
parameter is not null
.
- Specified by:
primaryToSecondary
in interface FudgeTypeConverter<String,BigDecimal>
- Overrides:
primaryToSecondary
in class SecondaryFieldType<BigDecimal,String>
- Parameters:
data
- the Fudge data
- Returns:
- a secondary type instance
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Released under the Apache License, Version 2.0