com.thinkaurelius.titan.core.schema

## Interface PropertyKeyMaker

- All Superinterfaces:
    RelationTypeMaker
  All Known Implementing Classes:
    StandardPropertyKeyMaker

      public interface PropertyKeyMaker
      extends RelationTypeMaker

  Used to define new `PropertyKey`s. An property key is defined by its name, `Cardinality`, its data type, and its signature - all of which can be specified in this builder.
  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `PropertyKeyMaker` | `cardinality(Cardinality cardinality)` Configures the `Cardinality` of this property key.
    `PropertyKeyMaker` | `dataType(Class<?> clazz)` Configures the data type for this property key.
    `PropertyKey` | `make()` Defines the `PropertyKey` specified by this PropertyKeyMaker and returns the resulting key.
    `PropertyKeyMaker` | `signature(RelationType... types)` Configures the signature of this relation type.

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

      `getName`

- - ### Method Detail

    - #### cardinality

          PropertyKeyMaker cardinality(Cardinality cardinality)

      Configures the `Cardinality` of this property key.
      Parameters:
        `cardinality` -
      Returns:
        this PropertyKeyMaker

    - #### dataType

          PropertyKeyMaker dataType(Class<?> clazz)

      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.
      Parameters:
        `clazz` - Data type to be configured.
      Returns:
        this PropertyKeyMaker
      See Also:
        `PropertyKey.getDataType()`

    - #### signature

          PropertyKeyMaker 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 `RelationTypeMaker`
      Parameters:
        `types` - RelationTypes composing the signature for the configured relation type. The order is irrelevant.
      Returns:
        this RelationTypeMaker

    - #### make

          PropertyKey make()

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

Copyright © 2012–2014. All rights reserved.