com.tc.object
Enum LiteralValues

java.lang.Object
  extended by java.lang.Enum<LiteralValues>
      extended by com.tc.object.LiteralValues
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<LiteralValues>

public enum LiteralValues
extends java.lang.Enum<LiteralValues>

Responsible for handling literal values


Enum Constant Summary
ARRAY
           
BIG_DECIMAL
           
BIG_INTEGER
           
BOOLEAN
           
BYTE
           
CHARACTER
           
CURRENCY
           
DOUBLE
           
ENUM
           
ENUM_HOLDER
           
FLOAT
           
INTEGER
          NOTE:: READ THIS IF YOU ARE ADDING NEW TYPES TO THIS FILE.
JAVA_LANG_CLASS
           
JAVA_LANG_CLASS_HOLDER
           
JAVA_LANG_CLASSLOADER
           
JAVA_LANG_CLASSLOADER_HOLDER
           
LONG
           
OBJECT
           
OBJECT_ID
           
SHORT
           
STACK_TRACE_ELEMENT
           
STRING
           
STRING_BYTES
           
STRING_BYTES_COMPRESSED
           
 
Field Summary
static java.lang.String ENUM_CLASS_DOTS
           
 
Method Summary
static int calculateDsoHashCode(java.lang.Object value)
          Calculate a stable hash code for the object.
 int calculateDsoHashCodeForLiteral(java.lang.Object value)
          Calculate a stable hash code for the object.
 java.lang.String getClassNameSlashForPrimitives()
           
 java.lang.String getInputMethodDescriptor()
           
 java.lang.String getInputMethodName()
           
 java.lang.String getMethodNameForPrimitives()
           
 java.lang.String getOutputMethodDescriptor()
           
 java.lang.String getOutputMethodName()
           
 java.lang.String getTypeDesc()
           
static java.util.Collection<java.lang.String> getTypes()
           
static boolean isLiteral(java.lang.String className)
          Determine whether a class is a literal
static boolean isLiteralInstance(java.lang.Object obj)
          Determine whether the instance is a literal

Returns false if the parameter is null

static LiteralValues valueFor(java.lang.Object pojo)
          Determine LiteralValue code for an instance object
static LiteralValues valueForClassName(java.lang.String className)
          Get literal value code for class name
static LiteralValues valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static LiteralValues[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

INTEGER

public static final LiteralValues INTEGER
NOTE:: READ THIS IF YOU ARE ADDING NEW TYPES TO THIS FILE. XXX:: If you are adding more types, please see DNAEncoding. You need to be adding New code in this class to properly handle encode/decode of the new type


LONG

public static final LiteralValues LONG

CHARACTER

public static final LiteralValues CHARACTER

FLOAT

public static final LiteralValues FLOAT

DOUBLE

public static final LiteralValues DOUBLE

BYTE

public static final LiteralValues BYTE

BOOLEAN

public static final LiteralValues BOOLEAN

SHORT

public static final LiteralValues SHORT

STRING

public static final LiteralValues STRING

ARRAY

public static final LiteralValues ARRAY

OBJECT

public static final LiteralValues OBJECT

OBJECT_ID

public static final LiteralValues OBJECT_ID

STRING_BYTES

public static final LiteralValues STRING_BYTES

JAVA_LANG_CLASS

public static final LiteralValues JAVA_LANG_CLASS

JAVA_LANG_CLASS_HOLDER

public static final LiteralValues JAVA_LANG_CLASS_HOLDER

STACK_TRACE_ELEMENT

public static final LiteralValues STACK_TRACE_ELEMENT

BIG_INTEGER

public static final LiteralValues BIG_INTEGER

BIG_DECIMAL

public static final LiteralValues BIG_DECIMAL

JAVA_LANG_CLASSLOADER

public static final LiteralValues JAVA_LANG_CLASSLOADER

JAVA_LANG_CLASSLOADER_HOLDER

public static final LiteralValues JAVA_LANG_CLASSLOADER_HOLDER

ENUM

public static final LiteralValues ENUM

ENUM_HOLDER

public static final LiteralValues ENUM_HOLDER

CURRENCY

public static final LiteralValues CURRENCY

STRING_BYTES_COMPRESSED

public static final LiteralValues STRING_BYTES_COMPRESSED
Field Detail

ENUM_CLASS_DOTS

public static final java.lang.String ENUM_CLASS_DOTS
See Also:
Constant Field Values
Method Detail

values

public static LiteralValues[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (LiteralValues c : LiteralValues.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static LiteralValues valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getInputMethodName

public java.lang.String getInputMethodName()

getInputMethodDescriptor

public java.lang.String getInputMethodDescriptor()

getOutputMethodName

public java.lang.String getOutputMethodName()

getOutputMethodDescriptor

public java.lang.String getOutputMethodDescriptor()

getTypeDesc

public java.lang.String getTypeDesc()

getClassNameSlashForPrimitives

public java.lang.String getClassNameSlashForPrimitives()

getMethodNameForPrimitives

public java.lang.String getMethodNameForPrimitives()

calculateDsoHashCodeForLiteral

public int calculateDsoHashCodeForLiteral(java.lang.Object value)
Calculate a stable hash code for the object. Many literals (like Integer) have stable hash codes already, but some (like Class) do not.

Parameters:
value - must refer to an object for which #isLiteralInstance() returns true. This implies that value must be non-null.

valueFor

public static LiteralValues valueFor(java.lang.Object pojo)
Determine LiteralValue code for an instance object

Parameters:
pojo - Object instance, should never be null
Returns:
Literal value code for the pojo's class

valueForClassName

public static LiteralValues valueForClassName(java.lang.String className)
Get literal value code for class name

Parameters:
className - Class name, may be null
Returns:
Literal value marker or OBJECT if className is null

isLiteral

public static boolean isLiteral(java.lang.String className)
Determine whether a class is a literal

Parameters:
className - Class name
Returns:
True if literal value class

isLiteralInstance

public static boolean isLiteralInstance(java.lang.Object obj)
Determine whether the instance is a literal

Returns false if the parameter is null

Parameters:
obj - Instance object, may be null
Returns:
True if literal value instance, false if null or not literal value instance

getTypes

public static java.util.Collection<java.lang.String> getTypes()

calculateDsoHashCode

public static int calculateDsoHashCode(java.lang.Object value)
Calculate a stable hash code for the object. Many literals (like Integer) have stable hash codes already, but some (like Class) do not.

Parameters:
value - must refer to an object for which #isLiteralInstance() returns true. This implies that value must be non-null.


Copyright © 2010 Terracotta, Inc.. All Rights Reserved.