Enum Class Severity

java.lang.Object
java.lang.Enum<Severity>
software.amazon.smithy.model.validation.Severity
All Implemented Interfaces:
Serializable, Comparable<Severity>, Constable, ToNode

public enum Severity extends Enum<Severity> implements ToNode
Severity level of a validation exception.
  • Enum Constant Details

    • SUPPRESSED

      public static final Severity SUPPRESSED
    • NOTE

      public static final Severity NOTE
    • WARNING

      public static final Severity WARNING
    • DANGER

      public static final Severity DANGER
    • ERROR

      public static final Severity ERROR
  • Method Details

    • values

      public static Severity[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Severity valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • canSuppress

      public boolean canSuppress()
      Check if the severity level of the error can be suppressed.
      Returns:
      Returns true if a suppression can silence errors at this severity level.
    • fromString

      public static Optional<Severity> fromString(String text)
      Create a new Severity from a string.
      Parameters:
      text - Text to convert into a severity level.
      Returns:
      Returns the format in an Optional.
    • fromNode

      public static Severity fromNode(Node node)
      Creates a severity value from a node.
      Parameters:
      node - Node to parse.
      Returns:
      Returns the parsed Severity.
      Throws:
      ExpectationNotMetException - if the node is invalid.
    • toNode

      public Node toNode()
      Description copied from interface: ToNode
      Converts a value to a Node.
      Specified by:
      toNode in interface ToNode
      Returns:
      Returns the creates Node.