org.fudgemsg.types.secondary
Class JavaUtilUUIDFieldType
java.lang.Object
org.fudgemsg.FudgeFieldType<SecondaryType>
org.fudgemsg.types.SecondaryFieldTypeBase<SecondaryType,PrimitiveType,PrimitiveType>
org.fudgemsg.types.SecondaryFieldType<UUID,byte[]>
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
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. |
INSTANCE
public static final JavaUtilUUIDFieldType INSTANCE
- Singleton instance of the type.
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