Package ai.chatur.cortex
Record Class BranchChange
java.lang.Object
java.lang.Record
ai.chatur.cortex.BranchChange
- Record Components:
subject- the full subject IRIpredicate- the full predicate IRI, or the prefixed short form when adding a statementobject- the current object — the full IRI of a resource, or the lexical form of a literal — ornullwhen adding a statementliteral- whether the object is a literaldatatype- the datatype IRI of a literal object, ornullfor a resourcelanguage- the language tag of a language-tagged literal object, ornullfor a resource or a literal without onenewObject- the replacement object, ornullto delete the statementretracted- whether the change addresses a statement the branch stages for removal rather than one it stages for addition; only meaningful forCortexBranches.updateBranch(java.lang.String, java.util.List<ai.chatur.cortex.BranchChange>), and only as a deletion — a staged retraction can be cancelled but not edited
public record BranchChange(String subject, String predicate, String object, boolean literal, String datatype, String language, String newObject, boolean retracted)
extends Record
A reviewer's change to a single statement: a deletion, an edit replacing the object, or an
addition.
object and newObject between them say which of the three it is. object
names the statement as it stands and newObject the statement to put in its place, so a
null on either side means that side does not exist:
- both non-
null— replace the object of the statement, newObject == null— delete the statement,object == null— add the statement; there is nothing to replace.
The same record describes an edit to a statement staged on a branch, applied by CortexBranches.updateBranch(java.lang.String, java.util.List<ai.chatur.cortex.BranchChange>), and a proposed edit to an already-approved statement, staged for
review by CortexIngestor.revise(ai.chatur.cortex.ResourceEdit).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondatatype()Returns the value of thedatatyperecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.language()Returns the value of thelanguagerecord component.booleanliteral()Returns the value of theliteralrecord component.Returns the value of thenewObjectrecord component.object()Returns the value of theobjectrecord component.Returns the value of thepredicaterecord component.booleanReturns the value of theretractedrecord component.subject()Returns the value of thesubjectrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
BranchChange
public BranchChange(String subject, String predicate, String object, boolean literal, String datatype, String language, String newObject, boolean retracted) Creates an instance of aBranchChangerecord class.- Parameters:
subject- the value for thesubjectrecord componentpredicate- the value for thepredicaterecord componentobject- the value for theobjectrecord componentliteral- the value for theliteralrecord componentdatatype- the value for thedatatyperecord componentlanguage- the value for thelanguagerecord componentnewObject- the value for thenewObjectrecord componentretracted- the value for theretractedrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
subject
Returns the value of thesubjectrecord component.- Returns:
- the value of the
subjectrecord component
-
predicate
Returns the value of thepredicaterecord component.- Returns:
- the value of the
predicaterecord component
-
object
Returns the value of theobjectrecord component.- Returns:
- the value of the
objectrecord component
-
literal
public boolean literal()Returns the value of theliteralrecord component.- Returns:
- the value of the
literalrecord component
-
datatype
Returns the value of thedatatyperecord component.- Returns:
- the value of the
datatyperecord component
-
language
Returns the value of thelanguagerecord component.- Returns:
- the value of the
languagerecord component
-
newObject
Returns the value of thenewObjectrecord component.- Returns:
- the value of the
newObjectrecord component
-
retracted
public boolean retracted()Returns the value of theretractedrecord component.- Returns:
- the value of the
retractedrecord component
-