Enum ShapeType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ShapeType>

    public enum ShapeType
    extends java.lang.Enum<ShapeType>
    An enumeration of the different types in a model.
    • Method Detail

      • values

        public static ShapeType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ShapeType c : ShapeType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ShapeType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<ShapeType>
      • getShapeClass

        public java.lang.Class<? extends Shape> getShapeClass()
        Gets the class that implements this shape type.
        Returns:
        Returns the shape class.
      • getCategory

        public ShapeType.Category getCategory()
        Returns the category of the shape type, as defined in the Smithy specification (one of SIMPLE, AGGREGATE, or SERVICE).
        Returns:
        Returns the category of the type.
      • isShapeType

        public boolean isShapeType​(ShapeType other)
        Returns whether this shape type is equivalent to the given shape type, accounting for things like enums being considered specializations of strings.
        Parameters:
        other - The other shape type to compare against.
        Returns:
        Returns true if the shape types are equivalent.
      • fromString

        public static java.util.Optional<ShapeType> fromString​(java.lang.String text)
        Create a new Shape.Type from a string.
        Parameters:
        text - Text to convert into a Shape.Type
        Returns:
        Returns the Type in an Optional.
      • createBuilderForType

        public AbstractShapeBuilder<?,​?> createBuilderForType()
        Creates a shape builder that corresponds to the shape type.
        Returns:
        Returns a shape builder corresponding to the type.