Class NullableIndex
- java.lang.Object
-
- software.amazon.smithy.model.knowledge.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 Summary
Constructors Constructor Description NullableIndex(Model model)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isNullable(ToShapeId shape)
Checks if the given shape can be set to null.static NullableIndex
of(Model model)
-
-
-
Constructor Detail
-
NullableIndex
public NullableIndex(Model model)
-
-
Method Detail
-
of
public static NullableIndex of(Model model)
-
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 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, or union.- Parameters:
shape
- Shape or shape ID to check.- Returns:
- Returns true if the shape can be set to null.
-
-