Class NullableIndex

  • All Implemented Interfaces:
    KnowledgeIndex
    Direct Known Subclasses:
    BoxIndex

    public class NullableIndex
    extends java.lang.Object
    implements KnowledgeIndex
    An index that checks if a shape can be set to null.
    • Constructor Detail

      • NullableIndex

        public NullableIndex​(Model model)
    • Method Detail

      • isNullable

        public final boolean isNullable​(ToShapeId shape)
        Checks if the given shape can be set to null.

        When given a list member or map value member, this method will return true if and only if the container of the member is marked with the SparseTrait. When given a member of a structure, this method will return true if and only if the member is marked with the BoxTrait, the targeted shape is marked with the box trait, or if the targeted shape is inherently boxed. When given a set member, union member, or map key member, this method will always return false. When given any other shape, this method will return true if the shape is inherently boxed, meaning the shape is either marked with the box trait, or the shape is a string, blob, timestamp, bigDecimal, bigInteger, list, set, map, structure, or union.

        Parameters:
        shape - Shape or shape ID to check.
        Returns:
        Returns true if the shape can be set to null.