Verified Owner
Top Description Inners Fields Constructors Methods
org.jabref.model.undo

public final Record ApplyResult

extends Record
Class Inheritance
Annotations
@NullMarked
Record Components
failures:List<ApplyResult.Failure>
the changes that were not applied, in the order they were attempted
Imports
java.util.List, org.jspecify.annotations.NullMarked

What applying a BibChange achieved.

Two things stop a change from being applied. A ChangeSet applies best-effort, aborting midway would leave the library in a state that is neither the old nor the new one, and that no later undo could describe, so it reports the elements that threw. And a change that describes one modification refuses when the library no longer holds the state it recorded, rather than writing over whatever is there now.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static record
ApplyResult.Failure

A change that was not applied, and why — the reason is for a log or a message, not for a caller to branch on.

Field Summary

Modifier and TypeField and Description
private final List<ApplyResult.Failure>
failures

Record Component accessed by failures().

the changes that were not applied, in the order they were attempted
public static final ApplyResult
SUCCESS

Everything asked for was applied.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public List<ApplyResult.Failure>
failures()

Record Component getter of failures.

Record Component the changes that were not applied, in the order they were attempted

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public static ApplyResult
of(BibChange change, String reason)

One change that was not applied.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

failuresback to summary
private final List<ApplyResult.Failure> failures

Record Component accessed by failures().

the changes that were not applied, in the order they were attempted

SUCCESSback to summary
public static final ApplyResult SUCCESS

Everything asked for was applied.

Constructor Detail

ApplyResultback to summary
public ApplyResult(List<ApplyResult.Failure> failures)

Method Detail

completeback to summary
public boolean complete()
equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
failuresback to summary
public List<ApplyResult.Failure> failures()

Record Component getter of failures.

Record Component
the changes that were not applied, in the order they were attempted
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

ofback to summary
public static ApplyResult of(BibChange change, String reason)

One change that was not applied.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

org.jabref.model.undo back to summary

public final Record ApplyResult.Failure

extends Record
Class Inheritance
Record Components
change:BibChange 
reason:String 

A change that was not applied, and why — the reason is for a log or a message, not for a caller to branch on.

Field Summary

Modifier and TypeField and Description
private final BibChange
change

Record Component accessed by change().

private final String
reason

Record Component accessed by reason().

Constructor Summary

AccessConstructor and Description
public
Failure(BibChange change, String reason)

Method Summary

Modifier and TypeMethod and Description
public BibChange
change()

Record Component getter of change.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public String
reason()

Record Component getter of reason.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

changeback to summary
private final BibChange change

Record Component accessed by change().

reasonback to summary
private final String reason

Record Component accessed by reason().

Constructor Detail

Failureback to summary
public Failure(BibChange change, String reason)

Method Detail

changeback to summary
public BibChange change()

Record Component getter of change.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

reasonback to summary
public String reason()

Record Component getter of reason.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.