Record Class SourcedElement
java.lang.Object
java.lang.Record
ca.mcscert.jpipe.operators.SourcedElement
- All Implemented Interfaces:
ElementView
public record SourcedElement(JustificationElement element, JustificationModel<?> source, SourceLocation location)
extends Record
implements ElementView
Pairs a
JustificationElement with the model it was taken from and its
original source location, so merge functions can inspect the element in its
original context and forward the location to creation commands.
Implements ElementView so that EquivalenceRelation
implementations can receive SourcedElements directly without needing
a separate adapter.
-
Constructor Summary
ConstructorsConstructorDescriptionSourcedElement(JustificationElement element, JustificationModel<?> source, SourceLocation location) Creates an instance of aSourcedElementrecord class. -
Method Summary
Modifier and TypeMethodDescriptionelement()Returns the value of theelementrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Unique identifier of this element within its containing model.label()Human-readable display label.location()Returns the value of thelocationrecord component.source()Returns the value of thesourcerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SourcedElement
public SourcedElement(JustificationElement element, JustificationModel<?> source, SourceLocation location) Creates an instance of aSourcedElementrecord class.- Parameters:
element- the value for theelementrecord componentsource- the value for thesourcerecord componentlocation- the value for thelocationrecord component
-
-
Method Details
-
id
Description copied from interface:ElementViewUnique identifier of this element within its containing model.- Specified by:
idin interfaceElementView
-
label
Description copied from interface:ElementViewHuman-readable display label.- Specified by:
labelin interfaceElementView
-
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). -
element
Returns the value of theelementrecord component.- Returns:
- the value of the
elementrecord component
-
source
Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-
location
Returns the value of thelocationrecord component.- Returns:
- the value of the
locationrecord component
-