Record Class Scenario2WrapperHelper.ContainerAccess
java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase7.Scenario2WrapperHelper.ContainerAccess
- Record Components:
presenceCheck- the presence-check method nameaccessor- 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 Summary
ConstructorsConstructorDescriptionContainerAccess(String presenceCheck, String accessor) Creates an instance of aContainerAccessrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaccessor()Returns the value of theaccessorrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thepresenceCheckrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ContainerAccess
Creates an instance of aContainerAccessrecord class.- Parameters:
presenceCheck- the value for thepresenceCheckrecord componentaccessor- the value for theaccessorrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
presenceCheck
Returns the value of thepresenceCheckrecord component.- Returns:
- the value of the
presenceCheckrecord component
-
accessor
-