Record Class RenderingResult

java.lang.Object
java.lang.Record
com.renomad.minum.templating.RenderingResult
Record Components:
renderedSection - The result of rendering this section. In the case of a TemplateSection that takes a key, this will be the result of replacing that with what the user provided.
appliedKey - In cases where a key was replaced with a value supplied by the user, this will supply the key that was replaced. This is useful to track how the supplied keys are being used in the template.

public record RenderingResult(String renderedSection, String appliedKey) extends Record
The result of rendering one of the TemplateSections, used to build up the full template. This is needed so we obtain information about whether our user-supplied keys were applied.
  • Constructor Details

    • RenderingResult

      public RenderingResult(String renderedSection, String appliedKey)
      Creates an instance of a RenderingResult record class.
      Parameters:
      renderedSection - the value for the renderedSection record component
      appliedKey - the value for the appliedKey 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.
    • renderedSection

      public String renderedSection()
      Returns the value of the renderedSection record component.
      Returns:
      the value of the renderedSection record component
    • appliedKey

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