com.devexperts.qd
Class SerialFieldType

java.lang.Object
  extended by com.devexperts.qd.SerialFieldType

public final class SerialFieldType
extends java.lang.Object

Describes serial type of data fields that are transferred via QTP. It describes the serialized form of the field in QTP protocol with enough detail to skip the serialized value of the field if necessary.


Nested Class Summary
static interface SerialFieldType.IntConverter
           
static interface SerialFieldType.ObjConverter
           
 
Field Summary
static SerialFieldType BYTE
           
static SerialFieldType BYTE_ARRAY
           
static SerialFieldType COMPACT_INT
           
static SerialFieldType CUSTOM_OBJECT
           
static SerialFieldType DATE
           
static SerialFieldType DECIMAL
           
static SerialFieldType INT
           
static int MAX_TYPE_ID
          Max type id that is supported now for plain field types.
static int MIN_TYPE_ID
          Min type id that is supported now for plain field types.
static int REPRESENTATION_MASK
          Masks representation bits of type id (encodes details of representation of the field value in the code).
static SerialFieldType SEQUENCE
           
static SerialFieldType SERIAL_OBJECT
           
static int SERIAL_TYPE_MASK
          This mask should be used to check if two types are equal in terms of their serial representations. 4 bits in REPRESENTATION_MASK are used for representation information.
static SerialFieldType SHORT
           
static SerialFieldType SHORT_STRING
           
static SerialFieldType STRING
           
static SerialFieldType TIME
           
static SerialFieldType UTF_CHAR
           
static SerialFieldType UTF_CHAR_ARRAY
           
static SerialFieldType VOID
           
 
Method Summary
 DataIntField createDefaultIntInstance(int index, java.lang.String name)
           
 DataObjField createDefaultObjInstance(int index, java.lang.String name)
           
 boolean equals(java.lang.Object o)
           
static SerialFieldType forId(int id)
          Returns standard serial field type for a given type identifier.
 SerialFieldType forNamedField(java.lang.String name)
          Returns a more specific serial type that shall be used for the field with the specified name.
 int getId()
           
 SerialFieldType.IntConverter getIntConverterFrom(SerialFieldType from)
           
 java.lang.String getName()
           
 SerialFieldType.ObjConverter getObjConverterFrom(SerialFieldType from)
           
 int hashCode()
           
 boolean hasSameRepresentationAs(SerialFieldType other)
           
 boolean hasSameSerialTypeAs(SerialFieldType other)
           
 boolean isObject()
           
 java.lang.String toString()
           
 SerialFieldType withName(java.lang.String name)
          Creates the same type as this one, but with a different name.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

REPRESENTATION_MASK

public static final int REPRESENTATION_MASK
Masks representation bits of type id (encodes details of representation of the field value in the code).

See Also:
Constant Field Values

SERIAL_TYPE_MASK

public static final int SERIAL_TYPE_MASK
This mask should be used to check if two types are equal in terms of their serial representations. 4 bits in REPRESENTATION_MASK are used for representation information.

See Also:
Constant Field Values

MIN_TYPE_ID

public static final int MIN_TYPE_ID
Min type id that is supported now for plain field types. Type ids beyond MIN_TYPE_ID to MAX_TYPE_ID can have additional information attached to them in the future, and the code should not attempt to parse their descriptions without knowing them.

See Also:
Constant Field Values

MAX_TYPE_ID

public static final int MAX_TYPE_ID
Max type id that is supported now for plain field types. Type ids beyond MIN_TYPE_ID to MAX_TYPE_ID can have additional information attached to them in the future, and the code should not attempt to parse their descriptions without knowing them.

See Also:
Constant Field Values

VOID

public static final SerialFieldType VOID

BYTE

public static final SerialFieldType BYTE

UTF_CHAR

public static final SerialFieldType UTF_CHAR

SHORT

public static final SerialFieldType SHORT

INT

public static final SerialFieldType INT

COMPACT_INT

public static final SerialFieldType COMPACT_INT

BYTE_ARRAY

public static final SerialFieldType BYTE_ARRAY

UTF_CHAR_ARRAY

public static final SerialFieldType UTF_CHAR_ARRAY

DECIMAL

public static final SerialFieldType DECIMAL

SHORT_STRING

public static final SerialFieldType SHORT_STRING

TIME

public static final SerialFieldType TIME

SEQUENCE

public static final SerialFieldType SEQUENCE

DATE

public static final SerialFieldType DATE

STRING

public static final SerialFieldType STRING

CUSTOM_OBJECT

public static final SerialFieldType CUSTOM_OBJECT

SERIAL_OBJECT

public static final SerialFieldType SERIAL_OBJECT
Method Detail

getId

public int getId()

getName

public java.lang.String getName()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isObject

public boolean isObject()

hasSameSerialTypeAs

public boolean hasSameSerialTypeAs(SerialFieldType other)

hasSameRepresentationAs

public boolean hasSameRepresentationAs(SerialFieldType other)

getIntConverterFrom

public SerialFieldType.IntConverter getIntConverterFrom(SerialFieldType from)

getObjConverterFrom

public SerialFieldType.ObjConverter getObjConverterFrom(SerialFieldType from)

withName

public SerialFieldType withName(java.lang.String name)
Creates the same type as this one, but with a different name.


forId

public static SerialFieldType forId(int id)
Returns standard serial field type for a given type identifier.


forNamedField

public SerialFieldType forNamedField(java.lang.String name)
Returns a more specific serial type that shall be used for the field with the specified name. For COMPACT_INT, DECIMAL, SHORT_STRING, and TIME base types this method looks at the suffix of the name, for other base types just the base type itself is returned.


createDefaultIntInstance

public DataIntField createDefaultIntInstance(int index,
                                             java.lang.String name)

createDefaultObjInstance

public DataObjField createDefaultObjInstance(int index,
                                             java.lang.String name)