com.thinkaurelius.titan.graphdb.types

## Class StandardPropertyKeyMaker

- java.lang.Object
- - com.thinkaurelius.titan.graphdb.types.StandardRelationTypeMaker
  - - com.thinkaurelius.titan.graphdb.types.StandardPropertyKeyMaker

- All Implemented Interfaces:
    PropertyKeyMaker, RelationTypeMaker

      public class StandardPropertyKeyMaker
      extends StandardRelationTypeMaker
      implements PropertyKeyMaker

  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Field Summary

    - ### Fields inherited from class com.thinkaurelius.titan.graphdb.types.StandardRelationTypeMaker

      `attributeHandler, indexSerializer, tx`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StandardPropertyKeyMaker(StandardTitanTx tx, IndexSerializer indexSerializer, AttributeHandling attributeHandler)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `StandardPropertyKeyMaker` | `cardinality(Cardinality cardinality)` Configures the `Cardinality` of this property key.
    `StandardPropertyKeyMaker` | `dataType(Class<?> clazz)` Configures the data type for this property key.
    `StandardPropertyKeyMaker` | `hidden()`
    `PropertyKey` | `make()` Defines the `PropertyKey` specified by this PropertyKeyMaker and returns the resulting key.
    `StandardPropertyKeyMaker` | `signature(RelationType... types)` Configures the signature of this relation type.
    `StandardPropertyKeyMaker` | `sortKey(RelationType... types)` Configures the composite sort key for this label.
    `StandardPropertyKeyMaker` | `sortOrder(Order order)` Defines in which order to sort the relations for efficient retrieval, i.e.

    - ### Methods inherited from class com.thinkaurelius.titan.graphdb.types.StandardRelationTypeMaker

      `checkName, getMultiplicity, getName, hasSortKey, makeDefinition, multiplicity, name, status`

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

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

    - ### Methods inherited from interface com.thinkaurelius.titan.core.schema.RelationTypeMaker

      `getName`

- - ### Constructor Detail

    - #### StandardPropertyKeyMaker

          public StandardPropertyKeyMaker(StandardTitanTx tx,
                                  IndexSerializer indexSerializer,
                                  AttributeHandling attributeHandler)

  - ### Method Detail

    - #### dataType

          public StandardPropertyKeyMaker dataType(Class<?> clazz)

      Description copied from interface: `PropertyKeyMaker`
      Configures the data type for this property key.

      Property instances for this key will only accept values that are instances of this class. Every property key must have its data type configured. Setting the data type to Object.class allows any type of value but comes at the expense of longer serialization because class information is stored with the value.

      It is strongly advised to pick an appropriate data type class so Titan can enforce it throughout the database.
      Specified by:
        `dataType` in interface `PropertyKeyMaker`
      Parameters:
        `clazz` - Data type to be configured.
      Returns:
        this PropertyKeyMaker
      See Also:
        `PropertyKey.getDataType()`

    - #### cardinality

          public StandardPropertyKeyMaker cardinality(Cardinality cardinality)

      Description copied from interface: `PropertyKeyMaker`
      Configures the `Cardinality` of this property key.
      Specified by:
        `cardinality` in interface `PropertyKeyMaker`
      Returns:
        this PropertyKeyMaker

    - #### hidden

          public StandardPropertyKeyMaker hidden()

      Overrides:
        `hidden` in class `StandardRelationTypeMaker`

    - #### signature

          public StandardPropertyKeyMaker signature(RelationType... types)

      Description copied from interface: `RelationTypeMaker`
      Configures the signature of this relation type.

      Specifying the signature of a type tells the graph database to expect that relations of this type always have or are likely to have an incident property or unidirected edge of the type included in the signature. This allows the graph database to store such relations more compactly and retrieve them more quickly.
      For instance, if all edges with label friend have a property with key createdOn, then specifying (createdOn) as the signature for label friend allows friend edges to be stored more efficiently.
      `RelationType`s used in the signature must be either property out-unique keys or out-unique unidirected edge labels.
      The signature is empty by default.
      Specified by:
        `signature` in interface `PropertyKeyMaker`
      Specified by:
        `signature` in interface `RelationTypeMaker`
      Overrides:
        `signature` in class `StandardRelationTypeMaker`
      Parameters:
        `types` - RelationTypes composing the signature for the configured relation type. The order is irrelevant.
      Returns:
        this RelationTypeMaker

    - #### sortKey

          public StandardPropertyKeyMaker sortKey(RelationType... types)

      Description copied from class: `StandardRelationTypeMaker`
      Configures the composite sort key for this label.

      Specifying the sort key of a type allows relations of this type to be efficiently retrieved in the order of the sort key.
      For instance, if the edge label friend has the sort key (since), which is a property key with a timestamp data type, then one can efficiently retrieve all edges with label friend in a specified time interval using `TitanVertexQuery.interval(com.thinkaurelius.titan.core.PropertyKey, Comparable, Comparable)`.
      In other words, relations are stored on disk in the order of the configured sort key. The sort key is empty by default.
      If multiple types are specified as sort key, then those are considered as a composite sort key, i.e. taken jointly in the given order.

      `RelationType`s used in the sort key must be either property out-unique keys or out-unique unidirected edge lables.
      Overrides:
        `sortKey` in class `StandardRelationTypeMaker`
      Parameters:
        `types` - TitanTypes composing the sort key. The order is relevant.
      Returns:
        this LabelMaker

    - #### sortOrder

          public StandardPropertyKeyMaker sortOrder(Order order)

      Description copied from class: `StandardRelationTypeMaker`
      Defines in which order to sort the relations for efficient retrieval, i.e. either increasing (`Order.ASC`) or decreasing (`Order.DESC`). Note, that only one sort order can be specified and that a sort key must be defined to use a sort order.
      Overrides:
        `sortOrder` in class `StandardRelationTypeMaker`
      Returns:
      See Also:
        `StandardRelationTypeMaker.sortKey(RelationType...)`

    - #### make

          public PropertyKey make()

      Description copied from interface: `PropertyKeyMaker`
      Defines the `PropertyKey` specified by this PropertyKeyMaker and returns the resulting key.
      Specified by:
        `make` in interface `PropertyKeyMaker`
      Specified by:
        `make` in interface `RelationTypeMaker`
      Returns:
        the created `PropertyKey`

Copyright © 2012–2014. All rights reserved.