com.thinkaurelius.titan.core.util

## Class TitanId

- java.lang.Object
- - com.thinkaurelius.titan.core.util.TitanId

-     public class TitanId
      extends Object

  Utility methods for handling Titan ids and converting them between indexing and storage backend representations.
  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TitanId()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static long` | `fromVertexId(long id)` Converts a Titan vertex id to the user provided id as the inverse mapping of `toVertexId(long)`.
    `static long` | `fromVertexID(TitanVertex v)` Converts a Titan vertex id of a given vertex to the user provided id as the inverse mapping of `toVertexId(long)`.
    `static long` | `toVertexId(long id)` Converts a user provided long id into a Titan vertex id.

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

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

- - ### Constructor Detail

    - #### TitanId

          public TitanId()

  - ### Method Detail

    - #### toVertexId

          public static final long toVertexId(long id)

      Converts a user provided long id into a Titan vertex id. The id must be positive and can be at most 61 bits long. This method is useful when providing ids during vertex creation via `Graph.addVertex(Object)`.
      Parameters:
        `id` - long id
      Returns:
        a corresponding Titan vertex id

    - #### fromVertexId

          public static final long fromVertexId(long id)

      Converts a Titan vertex id to the user provided id as the inverse mapping of `toVertexId(long)`.
      Parameters:
        `id` - Titan vertex id (must be positive)
      Returns:
        original user provided id

    - #### fromVertexID

          public static final long fromVertexID(TitanVertex v)

      Converts a Titan vertex id of a given vertex to the user provided id as the inverse mapping of `toVertexId(long)`.
      Parameters:
        `v` - Vertex
      Returns:
        original user provided id

Copyright © 2012–2014. All rights reserved.