Class StructuredObject

java.lang.Object
Services.ResponseAnalyzer.StructuredObject
All Implemented Interfaces:
Serializable

public class StructuredObject extends Object implements Serializable
Represents a structured part of an HTTP response.

A StructuredObject typically corresponds to a JSON object or array within an HTTP response. It can contain nested AtomicObject or StructuredObject instances in its objects list.

Upon creation, this class attempts to generate a JSON schema representation of its value by calling JsonSchemaGenerator.generateJSONSchema(String).

See Also:
  • Field Details

    • name

      @SerializedName("name") public String name
    • value

      @SerializedName("value") public String value
    • xpath

      @SerializedName("xpath") public String xpath
    • objects

      @SerializedName("objects") public List<Object> objects
  • Constructor Details

    • StructuredObject

      public StructuredObject(String name, String value, String xpath)
      Constructs a StructuredObject with the specified name, value, and XPath.
      Parameters:
      name - the name of the object, typically corresponding to the JSON key
      value - the raw JSON string or value of the object
      xpath - the XPath-like path representing the location of the object within the JSON hierarchy
      Throws:
      RuntimeException - if the JSON schema generation fails
  • Method Details

    • getName

      public String getName()
      Returns the name of the object.
    • getValue

      public String getValue()
      Returns the value of the object.
    • getObjects

      public List<Object> getObjects()
      Returns the list of child objects contained within this structured object.
    • setName

      public void setName(String name)
      Sets the name of the object.
    • setValue

      public void setValue(String value)
      Sets the value of the object.
    • setObjects

      public void setObjects(List<Object> objects)
      Sets the list of child objects for this structured object.
    • setSchemaString

      public void setSchemaString(String schemaString)
    • getXpath

      public String getXpath()
      Returns the XPath-like path of the object within the JSON hierarchy.
    • setXpath

      public void setXpath(String xpath)
      Sets the XPath-like path of the object within the JSON hierarchy.
    • getSchemaString

      public String getSchemaString()
      Returns the JSON schema string generated for this object.
    • toString

      public String toString()
      Returns a string representation of the object, including its name, value, number of child objects, JSON schema, and XPath.
      Overrides:
      toString in class Object