org.apache.tinkerpop.gremlin.structure

## Interface Graph.Features.ElementFeatures

- All Superinterfaces:
    Graph.Features.FeatureSet
  All Known Subinterfaces:
    Graph.Features.EdgeFeatures, Graph.Features.VertexFeatures
  Enclosing interface:
    Graph.Features

      public static interface Graph.Features.ElementFeatures
      extends Graph.Features.FeatureSet

  Features that are related to `Element` objects. This is a base interface.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `FEATURE_ADD_PROPERTY`
    `static String` | `FEATURE_ANY_IDS`
    `static String` | `FEATURE_CUSTOM_IDS`
    `static String` | `FEATURE_NULL_PROPERTY_VALUES`
    `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`

  - ### Method Summary

    All Methods Instance Methods Default Methods
    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` | `supportsNullPropertyValues()` Determines if an `Element` allows properties with `null` property values.
    `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`.

- - ### Field Detail

    - #### FEATURE_USER_SUPPLIED_IDS

          static final String FEATURE_USER_SUPPLIED_IDS

      See Also:
        Constant Field Values

    - #### FEATURE_NUMERIC_IDS

          static final String FEATURE_NUMERIC_IDS

      See Also:
        Constant Field Values

    - #### FEATURE_STRING_IDS

          static final String FEATURE_STRING_IDS

      See Also:
        Constant Field Values

    - #### FEATURE_UUID_IDS

          static final String FEATURE_UUID_IDS

      See Also:
        Constant Field Values

    - #### FEATURE_CUSTOM_IDS

          static final String FEATURE_CUSTOM_IDS

      See Also:
        Constant Field Values

    - #### FEATURE_ANY_IDS

          static final String FEATURE_ANY_IDS

      See Also:
        Constant Field Values

    - #### FEATURE_ADD_PROPERTY

          static final String FEATURE_ADD_PROPERTY

      See Also:
        Constant Field Values

    - #### FEATURE_REMOVE_PROPERTY

          static final String FEATURE_REMOVE_PROPERTY

      See Also:
        Constant Field Values

    - #### FEATURE_NULL_PROPERTY_VALUES

          static final String FEATURE_NULL_PROPERTY_VALUES

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### supportsNullPropertyValues

          default boolean supportsNullPropertyValues()

      Determines if an `Element` allows properties with `null` property values. In the event that this value is `false`, the underlying graph must treat `null` as an indication to remove the property.

    - #### supportsAddProperty

          default boolean supportsAddProperty()

      Determines if an `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)`.

    - #### supportsRemoveProperty

          default boolean supportsRemoveProperty()

      Determines if an `Element` allows properties to be removed.

    - #### supportsUserSuppliedIds

          default boolean supportsUserSuppliedIds()

      Determines if an `Element` can have a user defined identifier. Implementations 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 data type that the `Graph` will accept.

    - #### supportsNumericIds

          default boolean supportsNumericIds()

      Determines if an `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.

    - #### supportsStringIds

          default boolean supportsStringIds()

      Determines if an `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.

    - #### supportsUuidIds

          default boolean supportsUuidIds()

      Determines if an `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.

    - #### supportsCustomIds

          default boolean supportsCustomIds()

      Determines if an `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.

    - #### supportsAnyIds

          default boolean supportsAnyIds()

      Determines if an `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`.

    - #### willAllowId

          default boolean willAllowId(Object id)

      Determines if an identifier will be accepted by the `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–2021 Apache Software Foundation. All rights reserved.