Record Class MapBasedSubstitution
java.lang.Object
java.lang.Record
tools.refinery.logic.substitution.MapBasedSubstitution
- All Implemented Interfaces:
Substitution
public record MapBasedSubstitution(Map<Variable,Variable> map, Substitution fallback)
extends Record
implements Substitution
-
Constructor Summary
ConstructorsConstructorDescriptionMapBasedSubstitution(Map<Variable, Variable> map, Substitution fallback) Creates an instance of aMapBasedSubstitutionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.fallback()Returns the value of thefallbackrecord component.getSubstitute(Variable variable) final inthashCode()Returns a hash code value for this object.map()Returns the value of themaprecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface tools.refinery.logic.substitution.Substitution
getTypeSafeSubstitute, getTypeSafeSubstitute
-
Constructor Details
-
MapBasedSubstitution
Creates an instance of aMapBasedSubstitutionrecord class.- Parameters:
map- the value for themaprecord componentfallback- the value for thefallbackrecord component
-
-
Method Details
-
getSubstitute
- Specified by:
getSubstitutein interfaceSubstitution
-
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. -
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. -
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). -
map
Returns the value of themaprecord component.- Returns:
- the value of the
maprecord component
-
fallback
Returns the value of thefallbackrecord component.- Returns:
- the value of the
fallbackrecord component
-