Record Class HandlerJSentinelMetadata

java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.rest.openapi.HandlerJSentinelMetadata
Record Components:
handlerClassName - fully qualified handler class name; non-blank
classLevel - class-level requirements (apply to every method on the class); non-null, immutable
methods - per-method requirements keyed on method name; non-null, immutable, contains no null keys or values

@ExperimentalJSentinelApi public record HandlerJSentinelMetadata(String handlerClassName, List<JSentinelRequirement> classLevel, Map<String, List<JSentinelRequirement>> methods) extends Record
Result of running OpenApiJSentinelMetadataGenerator.generate(Class) on a handler class. Carries the class-level and per-method JSentinelRequirements the generator extracted.

Apps building an OpenAPI document combine classLevel() with each entry of methods() for the corresponding operation — the runtime evaluator AND-s them, so the OpenAPI exporter should reflect that.

  • Constructor Details

  • Method Details

    • isEmpty

      public boolean isEmpty()
      Returns:
      true when there is no class-level requirement and no method-level requirement
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • handlerClassName

      public String handlerClassName()
      Returns the value of the handlerClassName record component.
      Returns:
      the value of the handlerClassName record component
    • classLevel

      public List<JSentinelRequirement> classLevel()
      Returns the value of the classLevel record component.
      Returns:
      the value of the classLevel record component
    • methods

      public Map<String, List<JSentinelRequirement>> methods()
      Returns the value of the methods record component.
      Returns:
      the value of the methods record component