Record Class PConflict
java.lang.Object
java.lang.Record
ai.badmonkey.agentspaces.pdt.refs.PConflict
- Record Components:
name- the ref namekey- the key the decision was about, or null when a whole head was takenwinnerRoot- the root of the head whose value was keptloserRoot- the root of the head whose value was droppedreason- why: the later issued HLC, a registered merge function, or the missing common base of PD-R-06
public record PConflict(String name, String key, String winnerRoot, String loserRoot, String reason)
extends Record
A key changed on both sides of a merge to different values, or a whole head
taken over another (srad/agentspaces-pdt.md §3.6.1, PD-R-05, PD-R-06). A
reader records one event per decision, delivers it to the listeners of
Ref.onConflict(Consumer), and counts it in Pdt.stats().conflicts().-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe reason when both sides changed a key and the later issued head took it.static final StringThe reason when a registered merge function threw or returned null, so the rule of §3.6.1 decided instead.static final StringThe reason when the base walk of PD-R-06 found no common base within its bound.static final StringThe reason when a vector or blob has no registered merge function. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.Returns the value of theloserRootrecord component.name()Returns the value of thenamerecord component.reason()Returns the value of thereasonrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thewinnerRootrecord component.
-
Field Details
-
LATER_HLC
The reason when both sides changed a key and the later issued head took it.- See Also:
-
WHOLE_HEAD
The reason when a vector or blob has no registered merge function.- See Also:
-
NO_COMMON_BASE
The reason when the base walk of PD-R-06 found no common base within its bound.- See Also:
-
MERGE_FUNCTION_FAILED
The reason when a registered merge function threw or returned null, so the rule of §3.6.1 decided instead.- See Also:
-
-
Constructor Details
-
PConflict
Creates an instance of aPConflictrecord class.- Parameters:
name- the value for thenamerecord componentkey- the value for thekeyrecord componentwinnerRoot- the value for thewinnerRootrecord componentloserRoot- the value for theloserRootrecord componentreason- the value for thereasonrecord 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). -
name
-
key
-
winnerRoot
Returns the value of thewinnerRootrecord component.- Returns:
- the value of the
winnerRootrecord component
-
loserRoot
-
reason
-