Record Class StatusReporter

java.lang.Object
java.lang.Record
uk.ac.gda.services.common.device.api.StatusReporter
All Implemented Interfaces:
StatusBoolean.Reporter

public record StatusReporter(String reportWhenTrue, String reportWhenFalse, String reportOnError) extends Record implements StatusBoolean.Reporter
  • Constructor Details

    • StatusReporter

      public StatusReporter(String reportWhenTrue, String reportWhenFalse, String reportOnError)
      Creates an instance of a StatusReporter record class.
      Parameters:
      reportWhenTrue - the value for the reportWhenTrue record component
      reportWhenFalse - the value for the reportWhenFalse record component
      reportOnError - the value for the reportOnError record component
  • Method Details

    • getBuilder

      public static StatusReporter.Builder getBuilder()
    • 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.
    • reportWhenTrue

      public String reportWhenTrue()
      Returns the value of the reportWhenTrue record component.
      Specified by:
      reportWhenTrue in interface StatusBoolean.Reporter
      Returns:
      the value of the reportWhenTrue record component
    • reportWhenFalse

      public String reportWhenFalse()
      Returns the value of the reportWhenFalse record component.
      Specified by:
      reportWhenFalse in interface StatusBoolean.Reporter
      Returns:
      the value of the reportWhenFalse record component
    • reportOnError

      public String reportOnError()
      Returns the value of the reportOnError record component.
      Specified by:
      reportOnError in interface StatusBoolean.Reporter
      Returns:
      the value of the reportOnError record component