Verified Owner
Top Fields Constructors Methods
org.jabref.logic.git.merge.planning.util

public final Class FieldPatchComputer

extends Object
Class Inheritance
Imports
java.util.LinkedHashMap, .Map, .Objects, java.util.stream.Stream, org.jabref.model.entry.BibEntry, org.jabref.model.entry.field.Field, org.jabref.model.entry.types.StandardEntryType

Field Summary

Modifier and TypeField and Description
private static final BibEntry

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Map<Field, String>

Returns:

A map from field to new value
compute
(BibEntry
base version
base
,
BibEntry
local version
local
,
BibEntry
remote version
remote
)

Compares base and remote and constructs a patch at the field level.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTY_ENTRYback to summary
private static final BibEntry EMPTY_ENTRY

Constructor Detail

FieldPatchComputerback to summary
public FieldPatchComputer()

Method Detail

computeback to summary
public static Map<Field, String> compute(BibEntry base, BibEntry local, BibEntry remote)

Compares base and remote and constructs a patch at the field level. null == the field is deleted.

  • Apply remote change when local kept base value (including deletions: null);
  • If both sides changed to the same value, no patch needed;
  • Fallback: if a divergence is still observed, do not override local; skip this field,
Parameters
base:BibEntry

base version

local:BibEntry

local version

remote:BibEntry

remote version

Returns:Map<Field, String>

A map from field to new value