Class NullableIndex
java.lang.Object
software.amazon.smithy.model.knowledge.NullableIndex
- All Implemented Interfaces:
KnowledgeIndex
- Direct Known Subclasses:
BoxIndex
An index that checks if a shape can be set to null.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
isNullable
(ToShapeId shape) Checks if the given shape can be set to null.static NullableIndex
-
Constructor Details
-
NullableIndex
-
-
Method Details
-
of
-
isNullable
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 theBoxTrait
, the targeted shape is marked with thebox
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 thebox
trait, or the shape is a string, blob, timestamp, bigDecimal, bigInteger, list, set, map, structure, union or document.- Parameters:
shape
- Shape or shape ID to check.- Returns:
- Returns true if the shape can be set to null.
-