Class BoxIndex

  • All Implemented Interfaces:
    KnowledgeIndex

    public final class BoxIndex
    extends java.lang.Object
    implements KnowledgeIndex
    An index that checks if a shape is boxed or not.

    A service, resource, and operation are never considered boxed. A member is considered boxed if the member is targeted by the box trait or if the shape the member targets is considered boxed. A shape is considered boxed if it is targeted by the box trait or if the shape is a string, blob, timestamp, bigInteger, bigDecimal, list, set, map, structure, or union.

    • Constructor Summary

      Constructors 
      Constructor Description
      BoxIndex​(Model model)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isBoxed​(ToShapeId shape)
      Checks if the given shape should be considered boxed, meaning it accepts a null value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BoxIndex

        public BoxIndex​(Model model)
    • Method Detail

      • isBoxed

        public boolean isBoxed​(ToShapeId shape)
        Checks if the given shape should be considered boxed, meaning it accepts a null value.

        Note that "accepts a null value" means that the type that represents the shape, in code, accepts a null value or can be optionally set, but does not necessarily mean that sending a null value over the wire in a given protocol has any special meaning that's materially different than if a value is completely omitted.

        Parameters:
        shape - Shape to check.
        Returns:
        Returns true if the shape is effectively boxed.