public static interface Graph.Features.ElementFeatures extends Graph.Features.FeatureSet
Element
objects. This is a base interface.Type | Property and Description |
---|---|
default boolean |
supportsAdd
Determines if an
Element allows properties to be added. |
default boolean |
supportsRemove
Determines if an
Element allows properties to be removed. |
Modifier and Type | Field and Description |
---|---|
static String |
FEATURE_ADD_PROPERTY |
static String |
FEATURE_ANY_IDS |
static String |
FEATURE_CUSTOM_IDS |
static String |
FEATURE_NUMERIC_IDS |
static String |
FEATURE_REMOVE_PROPERTY |
static String |
FEATURE_STRING_IDS |
static String |
FEATURE_USER_SUPPLIED_IDS |
static String |
FEATURE_UUID_IDS |
Modifier and Type | Method and Description |
---|---|
default boolean |
supportsAddProperty()
Determines if an
Element allows properties to be added. |
default boolean |
supportsAnyIds()
Determines if an
Element any Java object is a suitable identifier. |
default boolean |
supportsCustomIds()
Determines if an
Element has a specific custom object as their internal representation. |
default boolean |
supportsNumericIds()
Determines if an
Element has numeric identifiers as their internal representation. |
default boolean |
supportsRemoveProperty()
Determines if an
Element allows properties to be removed. |
default boolean |
supportsStringIds()
Determines if an
Element has string identifiers as their internal representation. |
default boolean |
supportsUserSuppliedIds()
Determines if an
Element can have a user defined identifier. |
default boolean |
supportsUuidIds()
Determines if an
Element has UUID identifiers as their internal representation. |
default boolean |
willAllowId(Object id)
Determines if an identifier will be accepted by the
Graph . |
default boolean supportsAddProperty
Element
allows properties to be added. This feature is set independently from
supporting "data types" and refers to support of calls to Element.property(String, Object)
.default boolean supportsRemoveProperty
Element
allows properties to be removed.static final String FEATURE_USER_SUPPLIED_IDS
static final String FEATURE_NUMERIC_IDS
static final String FEATURE_STRING_IDS
static final String FEATURE_UUID_IDS
static final String FEATURE_CUSTOM_IDS
static final String FEATURE_ANY_IDS
static final String FEATURE_ADD_PROPERTY
static final String FEATURE_REMOVE_PROPERTY
default boolean supportsAddProperty()
Element
allows properties to be added. This feature is set independently from
supporting "data types" and refers to support of calls to Element.property(String, Object)
.default boolean supportsRemoveProperty()
Element
allows properties to be removed.default boolean supportsUserSuppliedIds()
Element
can have a user defined identifier. Implementation that do not support
this feature will be expected to auto-generate unique identifiers. In other words, if the Graph
allows graph.addVertex(id,x)
to work and thus set the identifier of the newly added
Vertex
to the value of x
then this feature should return true. In this case, x
is assumed to be an identifier datat ype that the Graph
will accept.default boolean supportsNumericIds()
Element
has numeric identifiers as their internal representation. In other
words, if the value returned from Element.id()
is a numeric value then this method
should be return true
.
Note that this feature is most generally used for determining the appropriate tests to execute in the
Gremlin Test Suite.default boolean supportsStringIds()
Element
has string identifiers as their internal representation. In other
words, if the value returned from Element.id()
is a string value then this method
should be return true
.
Note that this feature is most generally used for determining the appropriate tests to execute in the
Gremlin Test Suite.default boolean supportsUuidIds()
Element
has UUID identifiers as their internal representation. In other
words, if the value returned from Element.id()
is a UUID
value then this method
should be return true
.
Note that this feature is most generally used for determining the appropriate tests to execute in the
Gremlin Test Suite.default boolean supportsCustomIds()
Element
has a specific custom object as their internal representation.
In other words, if the value returned from Element.id()
is a type defined by the graph
implementations, such as OrientDB's Rid
, then this method should be return true
.
Note that this feature is most generally used for determining the appropriate tests to execute in the
Gremlin Test Suite.default boolean supportsAnyIds()
Element
any Java object is a suitable identifier. TinkerGraph is a good
example of a Graph
that can support this feature, as it can use any Object
as
a value for the identifier.
Note that this feature is most generally used for determining the appropriate tests to execute in the
Gremlin Test Suite. This setting should only return true
if supportsUserSuppliedIds()
is true
.default boolean willAllowId(Object id)
Graph
. This check is different than
what identifier internally supports as defined in methods like supportsNumericIds()
. Those
refer to internal representation of the identifier. A Graph
may accept an identifier that
is not of those types and internally transform it to a native representation.
Note that this method only applies if supportsUserSuppliedIds()
is true
. Those that
return false
for that method can immediately return false for this one as it allows no ids
of any type (it generates them all).
The default implementation will immediately return false
if supportsUserSuppliedIds()
is false
. If custom identifiers are supported then it will throw an exception. Those that
return true
for supportsCustomIds()
should override this method. If
supportsAnyIds()
is true
then the identifier will immediately be allowed. Finally,
if any of the other types are supported, they will be typed checked against the class of the supplied
identifier.Copyright © 2013–2017 Apache Software Foundation. All rights reserved.