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
ConstructorDescriptionMapBasedSubstitution
(Map<Variable, Variable> map, Substitution fallback) Creates an instance of aMapBasedSubstitution
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.fallback()
Returns the value of thefallback
record component.getSubstitute
(Variable variable) final int
hashCode()
Returns a hash code value for this object.map()
Returns the value of themap
record component.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface tools.refinery.logic.substitution.Substitution
getTypeSafeSubstitute, getTypeSafeSubstitute
-
Constructor Details
-
MapBasedSubstitution
Creates an instance of aMapBasedSubstitution
record class.- Parameters:
map
- the value for themap
record componentfallback
- the value for thefallback
record component
-
-
Method Details
-
getSubstitute
- Specified by:
getSubstitute
in 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 themap
record component.- Returns:
- the value of the
map
record component
-
fallback
Returns the value of thefallback
record component.- Returns:
- the value of the
fallback
record component
-