com.thinkaurelius.titan.graphdb.database.serialize.attribute

## Class CharacterSerializer

- java.lang.Object
- - com.thinkaurelius.titan.graphdb.database.serialize.attribute.CharacterSerializer

- All Implemented Interfaces:
    AttributeHandler<Character>, AttributeSerializer<Character>, OrderPreservingSerializer<Character>

      public class CharacterSerializer
      extends Object
      implements OrderPreservingSerializer<Character>

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CharacterSerializer()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static short` | `char2short(char c)`
    `Character` | `convert(Object value)` Converts the given (not-null) value to the expected datatype V.
    `Character` | `read(ScanBuffer buffer)` Reads an attribute from the given ReadBuffer.
    `Character` | `readByteOrder(ScanBuffer buffer)` Reads an attribute from the given ReadBuffer assuming it was written in byte order.
    `static char` | `short2char(short s)`
    `void` | `verifyAttribute(Character value)` Verifies the given (not-null) attribute value is valid.
    `void` | `write(WriteBuffer out, Character attribute)` Writes the attribute value to the given WriteBuffer.
    `void` | `writeByteOrder(WriteBuffer buffer, Character attribute)` Writes the attribute value to the given WriteBuffer such that the byte order of the result is equal to the natural order of the attribute.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CharacterSerializer

          public CharacterSerializer()

  - ### Method Detail

    - #### read

          public Character read(ScanBuffer buffer)

      Description copied from interface: `AttributeSerializer`
      Reads an attribute from the given ReadBuffer.

      It is expected that this read operation adjusts the position in the ReadBuffer to after the attribute value.
      Specified by:
        `read` in interface `AttributeSerializer<Character>`
      Parameters:
        `buffer` - ReadBuffer to read attribute from
      Returns:
        Read attribute

    - #### write

          public void write(WriteBuffer out,
                   Character attribute)

      Description copied from interface: `AttributeSerializer`
      Writes the attribute value to the given WriteBuffer.

      It is expected that this write operation adjusts the position in the WriteBuffer to after the attribute value.
      Specified by:
        `write` in interface `AttributeSerializer<Character>`
      Parameters:
        `out` - WriteBuffer to write attribute to
        `attribute` - Attribute to write to WriteBuffer

    - #### readByteOrder

          public Character readByteOrder(ScanBuffer buffer)

      Description copied from interface: `OrderPreservingSerializer`
      Reads an attribute from the given ReadBuffer assuming it was written in byte order.

      It is expected that this read operation adjusts the position in the ReadBuffer to after the attribute value.
      Specified by:
        `readByteOrder` in interface `OrderPreservingSerializer<Character>`
      Parameters:
        `buffer` - ReadBuffer to read attribute from
      Returns:
        Read attribute

    - #### writeByteOrder

          public void writeByteOrder(WriteBuffer buffer,
                            Character attribute)

      Description copied from interface: `OrderPreservingSerializer`
      Writes the attribute value to the given WriteBuffer such that the byte order of the result is equal to the natural order of the attribute.

      It is expected that this write operation adjusts the position in the WriteBuffer to after the attribute value.
      Specified by:
        `writeByteOrder` in interface `OrderPreservingSerializer<Character>`
      Parameters:
        `buffer` - WriteBuffer to write attribute to
        `attribute` - Attribute to write to WriteBuffer

    - #### char2short

          public static final short char2short(char c)

    - #### short2char

          public static final char short2char(short s)

    - #### verifyAttribute

          public void verifyAttribute(Character value)

      Description copied from interface: `AttributeHandler`
      Verifies the given (not-null) attribute value is valid. Throws an `IllegalArgumentException` if the value is invalid, otherwise simply returns.
      Specified by:
        `verifyAttribute` in interface `AttributeHandler<Character>`
      Parameters:
        `value` - to verify

    - #### convert

          public Character convert(Object value)

      Description copied from interface: `AttributeHandler`
      Converts the given (not-null) value to the expected datatype V. The given object will NOT be of type V. Throws an `IllegalArgumentException` if it cannot be converted.
      Specified by:
        `convert` in interface `AttributeHandler<Character>`
      Parameters:
        `value` - to convert
      Returns:
        converted to expected datatype

Copyright © 2012–2014. All rights reserved.