public class PrimitiveValue
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PrimitiveValue.Representation |
Constructor and Description |
---|
PrimitiveValue(byte[] value,
java.lang.String characterEncoding,
int size)
Construct and fill in value as a byte array.
|
PrimitiveValue(byte value,
java.lang.String characterEncoding)
Construct and fill in value as a long.
|
PrimitiveValue(double value,
int size)
Construct and fill in value as a double.
|
PrimitiveValue(long value,
int size)
Construct and fill in value as a long.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
byteArrayValue()
Return byte array value for this PrimitiveValue.
|
byte[] |
byteArrayValue(PrimitiveType type)
Return byte array value for this PrimitiveValue given a particular type
|
java.lang.String |
characterEncoding()
The character encoding of the byte array representation.
|
double |
doubleValue()
Return double value for this PrimitiveValue.
|
boolean |
equals(java.lang.Object value)
Determine if two values are equivalent.
|
int |
hashCode()
Return hashCode for value.
|
long |
longValue()
Return long value for this PrimitiveValue
|
static PrimitiveValue |
parse(java.lang.String value,
int length,
java.lang.String characterEncoding)
Parse constant value string and set representation based on type, length, and characterEncoding
|
static PrimitiveValue |
parse(java.lang.String value,
PrimitiveType primitiveType)
Parse constant value string and set representation based on type
|
static PrimitiveValue |
parse(java.lang.String value,
PrimitiveType primitiveType,
java.lang.String characterEncoding)
Parse constant value string and set representation based on type
|
PrimitiveValue.Representation |
representation()
Get the
PrimitiveValue.Representation of the value. |
int |
size()
Return encodedLength for this PrimitiveValue for serialization purposes.
|
java.lang.String |
toString()
Return String representation of this object
|
public static final long MIN_VALUE_CHAR
public static final long MAX_VALUE_CHAR
public static final long NULL_VALUE_CHAR
public static final long MIN_VALUE_INT8
public static final long MAX_VALUE_INT8
public static final long NULL_VALUE_INT8
public static final long MIN_VALUE_UINT8
public static final long MAX_VALUE_UINT8
public static final long NULL_VALUE_UINT8
public static final long MIN_VALUE_INT16
public static final long MAX_VALUE_INT16
public static final long NULL_VALUE_INT16
public static final long MIN_VALUE_UINT16
public static final long MAX_VALUE_UINT16
public static final long NULL_VALUE_UINT16
public static final long MIN_VALUE_INT32
public static final long MAX_VALUE_INT32
public static final long NULL_VALUE_INT32
public static final long MIN_VALUE_UINT32
public static final long MAX_VALUE_UINT32
public static final long NULL_VALUE_UINT32
public static final long MIN_VALUE_INT64
public static final long MAX_VALUE_INT64
public static final long NULL_VALUE_INT64
public static final long MIN_VALUE_UINT64
public static final java.math.BigInteger BI_MAX_VALUE_UINT64
public static final long MAX_VALUE_UINT64
public static final java.math.BigInteger BI_NULL_VALUE_UINT64
public static final long NULL_VALUE_UINT64
public static final float MIN_VALUE_FLOAT
public static final float MAX_VALUE_FLOAT
public static final float NULL_VALUE_FLOAT
public static final double MIN_VALUE_DOUBLE
public static final double MAX_VALUE_DOUBLE
public static final double NULL_VALUE_DOUBLE
public PrimitiveValue(long value, int size)
value
- in long formatsize
- of the type in bytespublic PrimitiveValue(byte value, java.lang.String characterEncoding)
value
- in long formatcharacterEncoding
- of the char type.public PrimitiveValue(double value, int size)
value
- in double formatsize
- of the type in bytespublic PrimitiveValue(byte[] value, java.lang.String characterEncoding, int size)
value
- as a byte arraycharacterEncoding
- of the characterssize
- of string in characterspublic PrimitiveValue.Representation representation()
PrimitiveValue.Representation
of the value.PrimitiveValue.Representation
of the value.public static PrimitiveValue parse(java.lang.String value, PrimitiveType primitiveType)
value
- expressed as a StringprimitiveType
- that this is supposed to bePrimitiveValue
for the value.java.lang.IllegalArgumentException
- if parsing malformed typepublic static PrimitiveValue parse(java.lang.String value, PrimitiveType primitiveType, java.lang.String characterEncoding)
value
- expressed as a StringprimitiveType
- that this is supposed to becharacterEncoding
- of the constant value.PrimitiveValue
for the value.java.lang.IllegalArgumentException
- if parsing malformed typepublic static PrimitiveValue parse(java.lang.String value, int length, java.lang.String characterEncoding)
value
- expressed as a Stringlength
- of the typecharacterEncoding
- of the StringPrimitiveValue
for the value.java.lang.IllegalArgumentException
- if parsing malformed typepublic long longValue()
java.lang.IllegalStateException
- if not a long value representationpublic double doubleValue()
java.lang.IllegalStateException
- if not a double value representationpublic byte[] byteArrayValue()
java.lang.IllegalStateException
- if not a byte array value representationpublic byte[] byteArrayValue(PrimitiveType type)
type
- of this valuejava.lang.IllegalStateException
- if not a byte array value representationpublic int size()
public java.lang.String characterEncoding()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object value)
equals
in class java.lang.Object
value
- to compare this value withpublic int hashCode()
hashCode
in class java.lang.Object
Copyright © 2014-2018 Real Logic Ltd. All Rights Reserved.