Record Class MockRequestServices

java.lang.Object
java.lang.Record
io.github.grumpystuff.grumpyrest.request.mock.MockRequestServices
Record Components:
fromStringParserRegistry - used to parse path arguments and querystring arguments
querystringParserRegistry - used to parse the whole querystring
jsonEngine - used to parse request bodies

public record MockRequestServices(FromStringParserRegistry fromStringParserRegistry, QuerystringParserRegistry querystringParserRegistry, StructuralJsonEngine jsonEngine) extends Record
Implements the infrastructure behind MockRequests, such as the JsonEngine to use.
  • Constructor Details

    • MockRequestServices

      public MockRequestServices()
      This constructor generates new registries for everything. Customized converters can be added to those registries later.
    • MockRequestServices

      public MockRequestServices(FromStringParserRegistry fromStringParserRegistry, QuerystringParserRegistry querystringParserRegistry, StructuralJsonEngine jsonEngine)
      Creates an instance of a MockRequestServices record class.
      Parameters:
      fromStringParserRegistry - the value for the fromStringParserRegistry record component
      querystringParserRegistry - the value for the querystringParserRegistry record component
      jsonEngine - the value for the jsonEngine record component
  • Method Details

    • 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.
    • fromStringParserRegistry

      public FromStringParserRegistry fromStringParserRegistry()
      Returns the value of the fromStringParserRegistry record component.
      Returns:
      the value of the fromStringParserRegistry record component
    • querystringParserRegistry

      public QuerystringParserRegistry querystringParserRegistry()
      Returns the value of the querystringParserRegistry record component.
      Returns:
      the value of the querystringParserRegistry record component
    • jsonEngine

      public StructuralJsonEngine jsonEngine()
      Returns the value of the jsonEngine record component.
      Returns:
      the value of the jsonEngine record component