Record Class JsonPath

java.lang.Object
java.lang.Record
io.jenkins.plugins.configsplice.engine.json.JsonPath

public record JsonPath(List<JsonPath.Step> steps) extends Record
A parsed JSON property path (SRS section 6.2).

Paths are compared structurally, so Serilog.'MinimumLevel.Default' and a path built programmatically from the same two steps are equal. That is what makes duplicate-path detection (SRS section 4.6) work on canonical form rather than on the raw string the user typed.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    Selects a zero-based array element.
    static final record 
    Selects an object property by exact, case-sensitive name.
    static interface 
    One navigation step: either an object property or a zero-based array index.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of a JsonPath record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Renders the path back into canonical source form, quoting members only where the grammar requires it.
    Debug helper listing each step in order; used by test failure messages.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the steps record component.
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • JsonPath

      public JsonPath(List<JsonPath.Step> steps)
      Creates an instance of a JsonPath record class.
      Parameters:
      steps - the value for the steps record component
  • Method Details

    • canonical

      public String canonical()
      Renders the path back into canonical source form, quoting members only where the grammar requires it. Used in diagnostics; never contains a value.
    • toString

      public 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
    • describeSteps

      public String describeSteps()
      Debug helper listing each step in order; used by test failure messages.
    • 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.
    • steps

      public List<JsonPath.Step> steps()
      Returns the value of the steps record component.
      Returns:
      the value of the steps record component