public class NullableIndex extends java.lang.Object implements KnowledgeIndex
Constructor and Description |
---|
NullableIndex(Model model) |
Modifier and Type | Method and Description |
---|---|
boolean |
isNullable(ToShapeId shape)
Checks if the given shape can be set to null.
|
static NullableIndex |
of(Model model) |
public NullableIndex(Model model)
public static NullableIndex of(Model model)
public final boolean isNullable(ToShapeId shape)
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, union or document.
shape
- Shape or shape ID to check.