Record Class Scenario2WrapperHelper.ContainerAccess

java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase7.Scenario2WrapperHelper.ContainerAccess
Record Components:
presenceCheck - the presence-check method name
accessor - the value-accessor method name
Enclosing class:
Scenario2WrapperHelper

static record Scenario2WrapperHelper.ContainerAccess(String presenceCheck, String accessor) extends Record
THE choice of the two calls a wrapper makes on its delegate to reach the contained value: the presence check and the accessor, which differ between Optional (_isSet / get) and Result (isOk / ok, or isError / error for whenError). Equality passes its operator name and so consults only the OK side, a deliberate design choice (see Scenario2EqualityGenerator).
  • Constructor Details

    • ContainerAccess

      ContainerAccess(String presenceCheck, String accessor)
      Creates an instance of a ContainerAccess record class.
      Parameters:
      presenceCheck - the value for the presenceCheck record component
      accessor - the value for the accessor 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.
    • presenceCheck

      public String presenceCheck()
      Returns the value of the presenceCheck record component.
      Returns:
      the value of the presenceCheck record component
    • accessor

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