Record Class LoadedSchema

java.lang.Object
java.lang.Record
com.bonitasoft.processbuilder.records.LoadedSchema
Record Components:
validator - The executable JSON Schema object used for validation.
titles - The map associating internal pointers (e.g., /allOf/0) to user-friendly component names.
targetSchemaName - The name of the schema component being validated (e.g., "Category").
jsonInput - The raw JSON content string being validated.

public record LoadedSchema(com.github.fge.jsonschema.main.JsonSchema validator, Map<String,String> titles, String targetSchemaName, String jsonInput) extends Record
Record representing a fully loaded and prepared JSON Schema used for validation.

This record holds the executable schema validator, a map of component titles for error reporting, the target schema's name, and the raw JSON input.

  • Constructor Details

    • LoadedSchema

      public LoadedSchema(com.github.fge.jsonschema.main.JsonSchema validator, Map<String,String> titles, String targetSchemaName, String jsonInput)
      Compact Canonical Constructor.

      Implements defensive copying for the mutable titles map to ensure the record's immutability upon construction (corrects EI_EXPOSE_REP2 in the constructor).

      Parameters:
      validator - The executable JSON Schema object used for validation.
      titles - The map associating internal pointers (e.g., /allOf/0) to user-friendly component names.
      targetSchemaName - The name of the schema component being validated (e.g., "Category").
      jsonInput - The raw JSON content string being validated.
  • Method Details

    • titles

      public Map<String,String> titles()
      Accessor method for the map of titles.

      Overrides the default accessor to return an unmodifiable view of the internal map, preventing external code from mutating the record's internal state (corrects EI_EXPOSE_REP2 in the getter).

      Returns:
      An unmodifiable view of the component titles map.
    • 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.
    • validator

      public com.github.fge.jsonschema.main.JsonSchema validator()
      Returns the value of the validator record component.
      Returns:
      the value of the validator record component
    • targetSchemaName

      public String targetSchemaName()
      Returns the value of the targetSchemaName record component.
      Returns:
      the value of the targetSchemaName record component
    • jsonInput

      public String jsonInput()
      Returns the value of the jsonInput record component.
      Returns:
      the value of the jsonInput record component