Enum Class SpecVersion

java.lang.Object
java.lang.Enum<SpecVersion>
io.cloudevents.SpecVersion
All Implemented Interfaces:
Serializable, Comparable<SpecVersion>, Constable

@ParametersAreNonnullByDefault public enum SpecVersion extends Enum<SpecVersion>
Represents one of the supported CloudEvents specification versions by this library
  • Enum Constant Details

  • Method Details

    • values

      public static SpecVersion[] 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 SpecVersion 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
    • toString

      public String toString()
      Overrides:
      toString in class Enum<SpecVersion>
    • parse

      public static SpecVersion parse(String sv)
      Parse a string as SpecVersion
      Parameters:
      sv - String representing the spec version
      Returns:
      The parsed spec version
      Throws:
      CloudEventRWException - When the spec version string is unrecognized
    • getMandatoryAttributes

      public Set<String> getMandatoryAttributes()
      Returns:
      mandatory attributes of the spec version
    • getOptionalAttributes

      public Set<String> getOptionalAttributes()
      Returns:
      optional attributes of the spec version
    • getAllAttributes

      public Set<String> getAllAttributes()
      Returns:
      all attributes for this spec