Class MemberShape

    • Method Detail

      • getContainer

        public ShapeId getContainer()
        Gets the shape in which the member is contained.
        Returns:
        Returns the containing shape id.
      • accept

        public <R> R accept​(ShapeVisitor<R> visitor)
        Description copied from class: Shape
        Dispatches the shape to the appropriate ShapeVisitor method.
        Specified by:
        accept in class Shape
        Type Parameters:
        R - Return type of the accept.
        Parameters:
        visitor - ShapeVisitor to use.
        Returns:
        Returns the result.
      • getType

        public ShapeType getType()
        Description copied from class: Shape
        Gets the type of the shape.
        Specified by:
        getType in class Shape
        Returns:
        Returns the type;
      • getTarget

        public ShapeId getTarget()
        Get the targeted member shape ID.
        Returns:
        Returns the member shape ID.
      • getMemberName

        public java.lang.String getMemberName()
        Get the member name of the member.
        Returns:
        Returns the member name.
      • isRequired

        public boolean isRequired()
        Returns:
        Returns true if the member has the required trait.
      • isOptional

        public boolean isOptional()
        Returns:
        Returns true if the member is not required.
      • hasNullDefault

        public boolean hasNullDefault()
        Returns:
        Returns true if the member has a default set explicitly to null.
      • hasNonNullDefault

        public boolean hasNonNullDefault()
        Returns:
        Returns true if the member has a default not set to null.
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class Shape
      • getMemberTrait

        public <T extends Trait> java.util.Optional<T> getMemberTrait​(Model model,
                                                                      java.lang.Class<T> trait)
        Description copied from class: Shape
        Gets a trait from the member shape or from the shape targeted by the member.

        If the shape is not a member, then the method functions the same as Shape.getTrait(Class).

        Overrides:
        getMemberTrait in class Shape
        Type Parameters:
        T - Trait type to get.
        Parameters:
        model - Model used to find member targets.
        trait - Trait type to get.
        Returns:
        Returns the optionally found trait on the shape or member.
        See Also:
        Shape.getTrait(Class)
      • findMemberTrait

        public java.util.Optional<Trait> findMemberTrait​(Model model,
                                                         java.lang.String traitName)
        Description copied from class: Shape
        Gets a trait from the member shape or from the shape targeted by the member.

        If the shape is not a member, then the method functions the same as Shape.findTrait(String).

        Overrides:
        findMemberTrait in class Shape
        Parameters:
        model - Model used to find member targets.
        traitName - Trait name to get.
        Returns:
        Returns the optionally found trait on the shape or member.
        See Also:
        Shape.findTrait(String)