public interface TypeMaker
TitanType
s. TitanTypes can be configured to provide data verification,
better storage efficiency, and higher performance. The TitanType defines the schema for all TitanRelation
s
of that type.
TitanTransaction.makeType()
.
Hence, types are defined within the context of a transaction like every other object in a TitanGraph. The TypeMaker
is used to create both: property keys and edge labels using either makePropertyKey()
or makeEdgeLabel()
,
respectively. Some of the methods in TypeMaker are only applicable to one or the other.
name(String)
to define the unqiue name of the type.
When defining property keys, one must also configure the data type using dataType(Class)
.TitanType
,
Titan Type WikiModifier and Type | Interface and Description |
---|---|
static class |
TypeMaker.UniquenessConsistency |
Modifier and Type | Method and Description |
---|---|
TypeMaker |
dataType(Class<?> clazz)
Configures the data type for this type.
|
TypeMaker |
directed()
Configures the type to be directed.
|
TypeMaker |
group(TypeGroup group)
Assigns the type to the specified
TypeGroup . |
TypeMaker |
indexed(Class<? extends com.tinkerpop.blueprints.Element> clazz)
Configures instances of this type to be indexed for the specified Element type using the standard Titan index.
|
TypeMaker |
indexed(String indexName,
Class<? extends com.tinkerpop.blueprints.Element> clazz)
Configures instances of this type to be indexed for the specified Element type using the external index with the given name.
|
TitanLabel |
makeEdgeLabel()
Creates an edge label according to the configuration of this TypeMaker.
|
TitanKey |
makePropertyKey()
Creates a property key according to the configuration of this TypeMaker.
|
TypeMaker |
name(String name)
Sets the name of the type
|
TypeMaker |
primaryKey(TitanType... types)
Configures the composite primary key for this type.
|
TypeMaker |
signature(TitanType... types)
Configures the signature of this type.
|
TypeMaker |
unidirected()
Configures the type to be unidirected.
|
TypeMaker |
unique(com.tinkerpop.blueprints.Direction direction)
Configures the type to be unique in the given direction with the default uniqueness consistency
TypeMaker.UniquenessConsistency.LOCK . |
TypeMaker |
unique(com.tinkerpop.blueprints.Direction direction,
TypeMaker.UniquenessConsistency consistency)
Configures the type to be unique in the given direction with the provided uniqueness consistency.
|
TypeMaker name(String name)
name
- name of the typeTitanType.getName()
TypeMaker unique(com.tinkerpop.blueprints.Direction direction, TypeMaker.UniquenessConsistency consistency)
TypeMaker unique(com.tinkerpop.blueprints.Direction direction)
TypeMaker.UniquenessConsistency.LOCK
.direction
- unique(com.tinkerpop.blueprints.Direction, com.thinkaurelius.titan.core.TypeMaker.UniquenessConsistency)
TypeMaker directed()
TitanLabel.isDirected()
TypeMaker unidirected()
TitanLabel.isUnidirected()
TypeMaker group(TypeGroup group)
TypeGroup
.
By default, the type is not assigned to TypeGroup.DEFAULT_GROUP
.group
- group to assign type to.TypeGroup
TypeMaker primaryKey(TitanType... types)
TitanVertexQuery.interval(TitanKey, Comparable, Comparable)
.
TitanType
s used in the primary key must be either property out-unique keys or out-unique unidirected edge lables.types
- TitanTypes composing the primary key. The order is relevant.TypeMaker signature(TitanType... types)
TitanType
s used in the primary key must be either property out-unique keys or out-unique unidirected edge lables.
types
- TitanTypes composing the primary key. The order is irrelevant.TypeMaker indexed(Class<? extends com.tinkerpop.blueprints.Element> clazz)
TitanKey.hasIndex(String, Class)
TypeMaker indexed(String indexName, Class<? extends com.tinkerpop.blueprints.Element> clazz)
TitanKey.hasIndex(String, Class)
TypeMaker dataType(Class<?> clazz)
clazz
- Data type to be configured.TitanKey.getDataType()
TitanLabel makeEdgeLabel()
IllegalArgumentException
- if the name is already in use or if other configurations are invalid.TitanKey makePropertyKey()
IllegalArgumentException
- if the name is already in use or if other configurations are invalid.Copyright © 2012-2013. All Rights Reserved.