Top Inners Fields Constructors Methods
org.jabref.logic.bibtex.comparator

public Class MetaDataDiff

extends Object
Class Inheritance
Imports
java.util.ArrayList, .List, .Map, .Objects, .Optional, org.jabref.logic.citationkeypattern.CitationKeyPattern, .GlobalCitationKeyPatterns, org.jabref.logic.groups.DefaultGroupsFactory, org.jabref.model.entry.field.Field, org.jabref.model.groups.GroupTreeNode, org.jabref.model.metadata.ContentSelectors, .MetaData

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static record
public static enum

Field Summary

Modifier and TypeField and Description
private final Optional<GroupDiff>
private final MetaData
private final MetaData

Constructor Summary

AccessConstructor and Description
private
MetaDataDiff(MetaData originalMetaData, MetaData newMetaData)

Method Summary

Modifier and TypeMethod and Description
private void
addToListIfDiff(List<MetaDataDiff.Difference> changes, MetaDataDiff.DifferenceType differenceType, Object originalObject, Object newObject)

public static Optional<MetaDataDiff>
compare(MetaData originalMetaData, MetaData newMetaData)

public List<MetaDataDiff.Difference>
getDifferences(GlobalCitationKeyPatterns globalCitationKeyPatterns)

Should be kept in sync with MetaData#equals(Object)

public Optional<GroupDiff>
getGroupDifferences()

Currently, the groups diff is contained here - and as entry in getDifferences(GlobalCitationKeyPatterns)

public MetaData
private static boolean
isDefaultContentSelectors(ContentSelectors contentSelectors)

Checks if given content selectors are empty or default

private boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

groupDiffback to summary
private final Optional<GroupDiff> groupDiff
newMetaDataback to summary
private final MetaData newMetaData
originalMetaDataback to summary
private final MetaData originalMetaData

Constructor Detail

MetaDataDiffback to summary
private MetaDataDiff(MetaData originalMetaData, MetaData newMetaData)

Method Detail

addToListIfDiffback to summary
private void addToListIfDiff(List<MetaDataDiff.Difference> changes, MetaDataDiff.DifferenceType differenceType, Object originalObject, Object newObject)
compareback to summary
public static Optional<MetaDataDiff> compare(MetaData originalMetaData, MetaData newMetaData)
getDifferencesback to summary
public List<MetaDataDiff.Difference> getDifferences(GlobalCitationKeyPatterns globalCitationKeyPatterns)

Should be kept in sync with MetaData#equals(Object)

getGroupDifferencesback to summary
public Optional<GroupDiff> getGroupDifferences()

Currently, the groups diff is contained here - and as entry in getDifferences(GlobalCitationKeyPatterns)

getNewMetaDataback to summary
public MetaData getNewMetaData()
isDefaultContentSelectorsback to summary
private static boolean isDefaultContentSelectors(ContentSelectors contentSelectors)

Checks if given content selectors are empty or default

isDefaultGroupback to summary
private boolean isDefaultGroup(Optional<GroupTreeNode> groups)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
org.jabref.logic.bibtex.comparator back to summary

public final Record MetaDataDiff.Difference

extends Record
Class Inheritance
Record Components
differenceType:MetaDataDiff.DifferenceType 
originalObject:Object 
newObject:Object 

Field Summary

Modifier and TypeField and Description
private final MetaDataDiff.DifferenceType
differenceType

Record Component accessed by differenceType().

private final Object
newObject

Record Component accessed by newObject().

private final Object
originalObject

Record Component accessed by originalObject().

Constructor Summary

AccessConstructor and Description
public
Difference(MetaDataDiff.DifferenceType differenceType, Object originalObject, Object newObject)

Method Summary

Modifier and TypeMethod and Description
public MetaDataDiff.DifferenceType
differenceType()

Record Component getter of differenceType.

public final boolean
equals(Object
the reference object with which to compare.
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 Object
newObject()

Record Component getter of newObject.

public Object
originalObject()

Record Component getter of originalObject.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

differenceTypeback to summary
private final MetaDataDiff.DifferenceType differenceType

Record Component accessed by differenceType().

newObjectback to summary
private final Object newObject

Record Component accessed by newObject().

originalObjectback to summary
private final Object originalObject

Record Component accessed by originalObject().

Constructor Detail

Differenceback to summary
public Difference(MetaDataDiff.DifferenceType differenceType, Object originalObject, Object newObject)

Method Detail

differenceTypeback to summary
public MetaDataDiff.DifferenceType differenceType()

Record Component getter of differenceType.

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).
Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this record is equal to the argument; false otherwise.

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.

Returns:int

a hash code value for this record.

newObjectback to summary
public Object newObject()

Record Component getter of newObject.

originalObjectback to summary
public Object originalObject()

Record Component getter of originalObject.

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.

Returns:String

a string representation of the object.

org.jabref.logic.bibtex.comparator back to summary

public final Enum MetaDataDiff.DifferenceType

extends Enum<MetaDataDiff.DifferenceType>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final MetaDataDiff.DifferenceType
public static final MetaDataDiff.DifferenceType
public static final MetaDataDiff.DifferenceType
public static final MetaDataDiff.DifferenceType
public static final MetaDataDiff.DifferenceType
public static final MetaDataDiff.DifferenceType
public static final MetaDataDiff.DifferenceType
public static final MetaDataDiff.DifferenceType
public static final MetaDataDiff.DifferenceType
public static final MetaDataDiff.DifferenceType
public static final MetaDataDiff.DifferenceType
public static final MetaDataDiff.DifferenceType

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static MetaDataDiff.DifferenceType
public static MetaDataDiff.DifferenceType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CONTENT_SELECTORback to summary
public static final MetaDataDiff.DifferenceType CONTENT_SELECTOR
DEFAULT_KEY_PATTERNback to summary
public static final MetaDataDiff.DifferenceType DEFAULT_KEY_PATTERN
ENCODINGback to summary
public static final MetaDataDiff.DifferenceType ENCODING
GENERAL_FILE_DIRECTORYback to summary
public static final MetaDataDiff.DifferenceType GENERAL_FILE_DIRECTORY
GROUPSback to summary
public static final MetaDataDiff.DifferenceType GROUPS
KEY_PATTERNSback to summary
public static final MetaDataDiff.DifferenceType KEY_PATTERNS
LATEX_FILE_DIRECTORYback to summary
public static final MetaDataDiff.DifferenceType LATEX_FILE_DIRECTORY
MODEback to summary
public static final MetaDataDiff.DifferenceType MODE
PROTECTEDback to summary
public static final MetaDataDiff.DifferenceType PROTECTED
SAVE_ACTIONSback to summary
public static final MetaDataDiff.DifferenceType SAVE_ACTIONS
SAVE_SORT_ORDERback to summary
public static final MetaDataDiff.DifferenceType SAVE_SORT_ORDER
USER_FILE_DIRECTORYback to summary
public static final MetaDataDiff.DifferenceType USER_FILE_DIRECTORY

Constructor Detail

DifferenceTypeback to summary
private DifferenceType()

Method Detail

valueOfback to summary
public static MetaDataDiff.DifferenceType valueOf(String name)
valuesback to summary
public static MetaDataDiff.DifferenceType[] values()