org.fudgemsg.types.secondary
Class JavaUtilCalendarFieldType

java.lang.Object
  extended by org.fudgemsg.FudgeFieldType<SecondaryType>
      extended by org.fudgemsg.types.SecondaryFieldTypeBase<Calendar,Object,FudgeDateTime>
          extended by org.fudgemsg.types.secondary.JavaUtilCalendarFieldType
All Implemented Interfaces:
Serializable, FudgeTypeConverter<Object,Calendar>

public class JavaUtilCalendarFieldType
extends SecondaryFieldTypeBase<Calendar,Object,FudgeDateTime>

Secondary type for Calendar conversion to/from a FudgeTime, FudgeDate or FudgeDateTime transport object.

See Also:
Serialized Form

Field Summary
static JavaUtilCalendarFieldType INSTANCE
          Singleton instance of the type.
 
Method Summary
 boolean canConvertPrimary(Class<?> javaType)
          Returns true if this converter can manipulate the requested class.
protected  Calendar primaryToSecondary(FudgeDate object)
          Primary to secondary conversion, where the primary type is a FudgeDate.
protected  Calendar primaryToSecondary(FudgeDateTime object)
          Primary to secondary conversion, where the primary type is a FudgeDateTime.
protected  Calendar primaryToSecondary(FudgeTime object)
          Primary to secondary conversion, where the primary type is a FudgeTime.
 Calendar primaryToSecondary(Object object)
          Converts an object to the secondary type this converter supports.
 FudgeDateTime secondaryToPrimary(Calendar object)
          Converts an object from the secondary type to a primitive Fudge type for writing.
 
Methods inherited from class org.fudgemsg.types.SecondaryFieldTypeBase
getPrimaryType, getVariableSize, readValue, writeValue
 
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 JavaUtilCalendarFieldType INSTANCE
Singleton instance of the type.

Method Detail

secondaryToPrimary

public FudgeDateTime secondaryToPrimary(Calendar object)
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<Calendar,Object,FudgeDateTime>
Parameters:
object - the secondary instance
Returns:
the underlying Fudge data to write out

primaryToSecondary

public Calendar primaryToSecondary(Object object)
Converts an object to the secondary type this converter supports.

Parameters:
object - to convert
Returns:
the converted object

primaryToSecondary

protected Calendar primaryToSecondary(FudgeDateTime object)
Primary to secondary conversion, where the primary type is a FudgeDateTime.

Parameters:
object - primary object
Returns:
the converted Calendar object

primaryToSecondary

protected Calendar primaryToSecondary(FudgeDate object)
Primary to secondary conversion, where the primary type is a FudgeDate.

Parameters:
object - primary object
Returns:
the converted Calendar object

primaryToSecondary

protected Calendar primaryToSecondary(FudgeTime object)
Primary to secondary conversion, where the primary type is a FudgeTime.

Parameters:
object - primary object
Returns:
the converted Calendar object

canConvertPrimary

public boolean canConvertPrimary(Class<?> javaType)
Returns true if this converter can manipulate the requested class.

Parameters:
javaType - to query
Returns:
true if a call to FudgeTypeConverter.primaryToSecondary(Primary) will succeed, false if it would fail


Copyright 2009-Present by OpenGamma Inc. and individual contributors
Released under the Apache License, Version 2.0