org.msgpack.value
Class ValueFactory

java.lang.Object
  extended by org.msgpack.value.ValueFactory

public class ValueFactory
extends java.lang.Object

Factory for creting Value instances


Constructor Summary
protected ValueFactory()
          Hide the default constructor to forbid instantiation of this class
 
Method Summary
static ArrayValue emptyArray()
           
static MapValue emptyMap()
           
static ArrayValue newArray(Value... array)
           
static ArrayValue newArrayFrom(java.util.List<? extends Value> list)
           
static IntegerValue newBigInteger(java.math.BigInteger v)
           
static BinaryValue newBinary(byte[] b)
           
static BinaryValue newBinary(byte[] b, int off, int len)
           
static BinaryValue newBinary(java.nio.ByteBuffer bb)
           
static BooleanValue newBoolean(boolean v)
           
static IntegerValue newByte(byte v)
           
static FloatValue newDouble(double v)
           
static ExtendedValue newExtendedValue(int extType, byte[] extData)
           
static ExtendedValue newExtendedValue(int extType, java.nio.ByteBuffer extData)
           
static FloatValue newFloat(float v)
           
static IntegerValue newInt(int v)
           
static IntegerValue newLong(long v)
           
static
<K extends Value,V extends Value>
MapValue
newMap(java.util.Map<K,V> map)
           
static MapValue newMap(Value[] keyValueSequence)
           
static StringValue newRawString(byte[] b)
           
static StringValue newRawString(byte[] b, int off, int len)
           
static StringValue newRawString(java.nio.ByteBuffer bb)
           
static IntegerValue newShort(short v)
           
static StringValue newString(java.lang.String s)
           
static NilValue nilValue()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueFactory

protected ValueFactory()
Hide the default constructor to forbid instantiation of this class

Method Detail

nilValue

public static NilValue nilValue()

newBoolean

public static BooleanValue newBoolean(boolean v)

newByte

public static IntegerValue newByte(byte v)

newShort

public static IntegerValue newShort(short v)

newInt

public static IntegerValue newInt(int v)

newLong

public static IntegerValue newLong(long v)

newBigInteger

public static IntegerValue newBigInteger(java.math.BigInteger v)

newFloat

public static FloatValue newFloat(float v)

newDouble

public static FloatValue newDouble(double v)

newBinary

public static BinaryValue newBinary(byte[] b)

newBinary

public static BinaryValue newBinary(byte[] b,
                                    int off,
                                    int len)

newBinary

public static BinaryValue newBinary(java.nio.ByteBuffer bb)

newString

public static StringValue newString(java.lang.String s)

newRawString

public static StringValue newRawString(byte[] b)

newRawString

public static StringValue newRawString(byte[] b,
                                       int off,
                                       int len)

newRawString

public static StringValue newRawString(java.nio.ByteBuffer bb)

newArrayFrom

public static ArrayValue newArrayFrom(java.util.List<? extends Value> list)

newArray

public static ArrayValue newArray(Value... array)

emptyArray

public static ArrayValue emptyArray()

newMap

public static <K extends Value,V extends Value> MapValue newMap(java.util.Map<K,V> map)

newMap

public static MapValue newMap(Value[] keyValueSequence)

emptyMap

public static MapValue emptyMap()

newExtendedValue

public static ExtendedValue newExtendedValue(int extType,
                                             byte[] extData)

newExtendedValue

public static ExtendedValue newExtendedValue(int extType,
                                             java.nio.ByteBuffer extData)