Interface Graph.Features.ElementFeatures

    • 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.