org.fudgemsg.types.secondary
Class JavaUtilUUIDFieldType

java.lang.Object
  extended by org.fudgemsg.FudgeFieldType<SecondaryType>
      extended by org.fudgemsg.types.SecondaryFieldTypeBase<SecondaryType,PrimitiveType,PrimitiveType>
          extended by org.fudgemsg.types.SecondaryFieldType<UUID,byte[]>
              extended by org.fudgemsg.types.secondary.JavaUtilUUIDFieldType
All Implemented Interfaces:
Serializable, FudgeTypeConverter<byte[],UUID>

public class JavaUtilUUIDFieldType
extends SecondaryFieldType<UUID,byte[]>

Secondary type for UUID conversion to/from byte[]. The conversion is most significant bits first.

See Also:
Serialized Form

Field Summary
static JavaUtilUUIDFieldType INSTANCE
          Singleton instance of the type.
 
Method Summary
 UUID primaryToSecondary(byte[] data)
          Converts Fudge primitive data to the secondary type.
 byte[] secondaryToPrimary(UUID 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 JavaUtilUUIDFieldType INSTANCE
Singleton instance of the type.

Method Detail

secondaryToPrimary

public byte[] secondaryToPrimary(UUID 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<UUID,byte[],byte[]>
Parameters:
object - the secondary instance
Returns:
the underlying Fudge data to write out

primaryToSecondary

public UUID primaryToSecondary(byte[] 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<byte[],UUID>
Overrides:
primaryToSecondary in class SecondaryFieldType<UUID,byte[]>
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