org.fudgemsg.types.secondary
Class JavaMathBigDecimalFieldType

java.lang.Object
  extended by org.fudgemsg.FudgeFieldType<SecondaryType>
      extended by org.fudgemsg.types.SecondaryFieldTypeBase<SecondaryType,PrimitiveType,PrimitiveType>
          extended by org.fudgemsg.types.SecondaryFieldType<BigDecimal,String>
              extended by 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

Field Summary
static JavaMathBigDecimalFieldType INSTANCE
          Singleton instance of the type.
 
Method Summary
 BigDecimal primaryToSecondary(String data)
          Converts Fudge primitive data to the secondary type.
 String secondaryToPrimary(BigDecimal object)
          Converts an object from the secondary type to a primitive Fudge type for writing.
 
Methods inherited from class org.fudgemsg.types.SecondaryFieldType
canConvertPrimary, readValue, writeValue
 
Methods inherited from class org.fudgemsg.types.SecondaryFieldTypeBase
getPrimaryType, getVariableSize
 
Methods inherited from class org.fudgemsg.FudgeFieldType
equals, getFixedSize, getJavaType, getTypeId, hashCode, isVariableSize, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

INSTANCE

public static final JavaMathBigDecimalFieldType INSTANCE
Singleton instance of the type.

Method Detail

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