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

## Class StringArraySerializer

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

- All Implemented Interfaces:
    AttributeHandler<String[]>, AttributeSerializer<String[]>, SupportsNullSerializer

      public class StringArraySerializer
      extends ArraySerializer
      implements AttributeSerializer<String[]>

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StringArraySerializer()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String[]` | `convert(Object value)` Converts the given (not-null) value to the expected datatype V.
    `protected Object` | `getArray(int length)`
    `String[]` | `read(ScanBuffer buffer)` Reads an attribute from the given ReadBuffer.
    `protected void` | `setArray(Object array, int pos, Object value)`
    `void` | `verifyAttribute(String[] value)` Verifies the given (not-null) attribute value is valid.
    `void` | `write(WriteBuffer buffer, String[] attribute)` Writes the attribute value to the given WriteBuffer.

    - ### Methods inherited from class com.thinkaurelius.titan.graphdb.database.serialize.attribute.ArraySerializer

      `getLength, isArrayOf, isIterableOf, writeLength`

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

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

- - ### Constructor Detail

    - #### StringArraySerializer

          public StringArraySerializer()

  - ### Method Detail

    - #### verifyAttribute

          public void verifyAttribute(String[] 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<String[]>`
      Parameters:
        `value` - to verify

    - #### convert

          public String[] 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<String[]>`
      Parameters:
        `value` - to convert
      Returns:
        converted to expected datatype

    - #### getArray

          protected Object getArray(int length)

      Specified by:
        `getArray` in class `ArraySerializer`

    - #### setArray

          protected void setArray(Object array,
                      int pos,
                      Object value)

      Specified by:
        `setArray` in class `ArraySerializer`

    - #### read

          public String[] 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<String[]>`
      Parameters:
        `buffer` - ReadBuffer to read attribute from
      Returns:
        Read attribute

    - #### write

          public void write(WriteBuffer buffer,
                   String[] 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<String[]>`
      Parameters:
        `buffer` - WriteBuffer to write attribute to
        `attribute` - Attribute to write to WriteBuffer

Copyright © 2012–2014. All rights reserved.