com.thinkaurelius.titan.core.attribute

## Interface AttributeHandler<V>

- All Known Subinterfaces:
    AttributeSerializer<V>, 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 AttributeHandler<V>

  Allows custom handling of attributes inside Titan when it comes to a) data validation and b) conversion of different data types to the target type.
  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `V` | `convert(Object value)` Converts the given (not-null) value to the expected datatype V.
    `void` | `verifyAttribute(V value)` Verifies the given (not-null) attribute value is valid.

- - ### Method Detail

    - #### verifyAttribute

          void verifyAttribute(V value)

      Verifies the given (not-null) attribute value is valid. Throws an `IllegalArgumentException` if the value is invalid, otherwise simply returns.
      Parameters:
        `value` - to verify

    - #### convert

          V convert(Object value)

      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.
      Parameters:
        `value` - to convert
      Returns:
        converted to expected datatype

Copyright © 2012–2014. All rights reserved.