com.thinkaurelius.titan.core.attribute

## Interface AttributeSerializer<V>

- Type Parameters:
    `V` - Type of the attribute associated with the AttributeSerializer
  All Superinterfaces:
    AttributeHandler<V>
  All Known Subinterfaces:
    OrderPreservingSerializer<V>
  All Known Implementing Classes:
    AbstractDecimal.AbstractDecimalSerializer, BooleanArraySerializer, BooleanSerializer, ByteArraySerializer, ByteSerializer, CharacterSerializer, CharArraySerializer, DateSerializer, Decimal.DecimalSerializer, DoubleArraySerializer, DoubleSerializer, FloatArraySerializer, FloatSerializer, Geoshape.GeoshapeSerializer, IntArraySerializer, IntegerSerializer, LongArraySerializer, LongSerializer, Precision.PrecisionSerializer, ShortArraySerializer, ShortSerializer, StringArraySerializer, StringSerializer

      public interface AttributeSerializer<V>
      extends AttributeHandler<V>

  Allows custom serializer definitions for attribute values.

  For most data types (i.e. classes) used with properties, using the default serializer when registering the type with the Titan will be sufficient and efficient in practice. However, for certain data types, it can be more efficient to provide custom serializers implementing this interface. Such custom serializers are registered in the configuration file by specifying their path and loaded when the database is initialized. Hence, the serializer must be on the classpath.

  When a `PropertyKey` is defined using a data type specified via `PropertyKeyMaker` for which a custom serializer is configured, then it will use this custom serializer for persistence operations.
  Author:
    Matthias Bröcheler (http://www.matthiasb.com)
  See Also:
    `RelationTypeMaker`, Graph Configuration Wiki

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `V` | `read(ScanBuffer buffer)` Reads an attribute from the given ReadBuffer.
    `void` | `write(WriteBuffer buffer, V attribute)` Writes the attribute value to the given WriteBuffer.

    - ### Methods inherited from interface com.thinkaurelius.titan.core.attribute.AttributeHandler

      `convert, verifyAttribute`

- - ### Method Detail

    - #### read

          V read(ScanBuffer buffer)

      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.
      Parameters:
        `buffer` - ReadBuffer to read attribute from
      Returns:
        Read attribute

    - #### write

          void write(WriteBuffer buffer,
                   V attribute)

      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.
      Parameters:
        `buffer` - WriteBuffer to write attribute to
        `attribute` - Attribute to write to WriteBuffer

Copyright © 2012–2014. All rights reserved.