Verified Owner
Top Description Fields Constructors Methods
org.jabref.model.entry.event

public Class FieldChangedEvent

extends EntryChangedEvent
Class Inheritance
Known Direct Subclasses
org.jabref.model.entry.event.FieldAddedOrRemovedEvent
Annotations
@NullMarked
Imports
java.util.Objects, org.jabref.model.FieldChange, org.jabref.model.entry.BibEntry, org.jabref.model.entry.field.Field, org.jspecify.annotations.NullMarked, .Nullable

FieldChangedEvent is fired when a field of BibEntry has been modified, removed or added.

A value is null when the field had none: before the field was added, or after it was removed.

Field Summary

Modifier and TypeField and Description
private int
private final Field
private final @Nullable String
private final @Nullable String

Constructor Summary

AccessConstructor and Description
public
FieldChangedEvent(EntriesEventSource
source of this event
source
,
BibEntry
Affected BibEntry object
bibEntry
,
Field
Name of field which has been changed
field
,
@Nullable String
old field value
oldValue
,
@Nullable String
new field value
newValue
)

public
FieldChangedEvent(BibEntry
Affected BibEntry object
bibEntry
,
Field
Name of field which has been changed
field
,
@Nullable String oldValue, @Nullable String
new field value
newValue
)

public
public

Method Summary

Modifier and TypeMethod and Description
public int
private static int
computeMajorCharacterChange(@Nullable String oldValue, @Nullable String newValue)

An absent value counts as empty: adding a value changes as many characters as it is long.

public Field
public @Nullable String
public @Nullable String
Inherited from org.jabref.model.entry.event.EntryChangedEvent:
getBibEntry

Field Detail

charactersChangedCountback to summary
private int charactersChangedCount
fieldback to summary
private final Field field
newValueback to summary
private final @Nullable String newValue
oldValueback to summary
private final @Nullable String oldValue

Constructor Detail

FieldChangedEventback to summary
public FieldChangedEvent(EntriesEventSource source, BibEntry bibEntry, Field field, @Nullable String oldValue, @Nullable String newValue)
Parameters
source:EntriesEventSource

source of this event

bibEntry:BibEntry

Affected BibEntry object

field:Field

Name of field which has been changed

oldValue:@Nullable String

old field value

newValue:@Nullable String

new field value

FieldChangedEventback to summary
public FieldChangedEvent(BibEntry bibEntry, Field field, @Nullable String oldValue, @Nullable String newValue)
Parameters
bibEntry:BibEntry

Affected BibEntry object

field:Field

Name of field which has been changed

newValue:@Nullable String

new field value

FieldChangedEventback to summary
public FieldChangedEvent(EntriesEventSource source, FieldChange fieldChange)
FieldChangedEventback to summary
public FieldChangedEvent(FieldChange fieldChange)

Method Detail

charactersChangedCountback to summary
public int charactersChangedCount()
computeMajorCharacterChangeback to summary
private static int computeMajorCharacterChange(@Nullable String oldValue, @Nullable String newValue)

An absent value counts as empty: adding a value changes as many characters as it is long.

getFieldback to summary
public Field getField()
getNewValueback to summary
public @Nullable String getNewValue()
getOldValueback to summary
public @Nullable String getOldValue()