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

public Class BibEntryType

extends Object
implements Comparable<BibEntryType>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable
Imports
java.util.Collection, .Collections, .HashSet, .LinkedHashSet, .Objects, .SequencedSet, .Set, java.util.stream.Collectors, org.jabref.model.database.BibDatabaseMode, org.jabref.model.entry.field.BibField, .Field, .FieldPriority, .OrFields, .StandardField, org.jabref.model.entry.types.EntryType, org.jspecify.annotations.NonNull

Field Summary

Modifier and TypeField and Description
private final SequencedSet<BibField>
private final SequencedSet<OrFields>
private final EntryType

Constructor Summary

AccessConstructor and Description
public
BibEntryType(@NonNull EntryType
The EntryType this BibEntryType is wrapped around.
type
,
Collection<BibField>
A BibFields list of all fields, including the required fields
allFields
,
Collection<OrFields>
A OrFields list of just the required fields
requiredFields
)

Provides an enriched EntryType with information about defined standards as mandatory fields etc.

A builder is available at BibEntryTypeBuilder

Method Summary

Modifier and TypeMethod and Description
public int
compareTo(BibEntryType o)

Implements java.lang.Comparable.compareTo.

Warning

This does not follow the equals contract.

public boolean
equals(Object o)

Overrides java.lang.Object.equals.

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

public SequencedSet<BibField>
getAllBibFields()

Returns all defined fields.

public Set<Field>
public Set<Field>
public SequencedSet<Field>
public SequencedSet<Field>
public SequencedSet<Field>
public SequencedSet<BibField>
private SequencedSet<Field>
getOptionalFieldsAndAliases()

Get list of all optional fields of this entry and all fields being source for a BibTeX to BibLaTeX conversion.

public SequencedSet<OrFields>

Returns:

a Set of required field name Strings
getRequiredFields
()

Returns all required field names.

public EntryType
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean
public String
toString()

Overrides java.lang.Object.toString.

Generates a single line string containing the information.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

allFieldsback to summary
private final SequencedSet<BibField> allFields
requiredFieldsback to summary
private final SequencedSet<OrFields> requiredFields
typeback to summary
private final EntryType type

Constructor Detail

BibEntryTypeback to summary
public BibEntryType(@NonNull EntryType type, Collection<BibField> allFields, Collection<OrFields> requiredFields)

Provides an enriched EntryType with information about defined standards as mandatory fields etc.

A builder is available at BibEntryTypeBuilder

Parameters
type:@NonNull EntryType

The EntryType this BibEntryType is wrapped around.

allFields:Collection<BibField>

A BibFields list of all fields, including the required fields

requiredFields:Collection<OrFields>

A OrFields list of just the required fields

Method Detail

compareToback to summary
public int compareTo(BibEntryType o)

Implements java.lang.Comparable.compareTo.

Warning

This does not follow the equals contract. Even if this here returns 0, the objects can be different.

Annotations
@Override
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

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

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
getAllBibFieldsback to summary
public SequencedSet<BibField> getAllBibFields()

Returns all defined fields.

getAllFieldsback to summary
public Set<Field> getAllFields()
getDeprecatedFieldsback to summary
public Set<Field> getDeprecatedFields(BibDatabaseMode mode)
getDetailOptionalFieldsback to summary
public SequencedSet<Field> getDetailOptionalFields()
getDetailOptionalNotDeprecatedFieldsback to summary
public SequencedSet<Field> getDetailOptionalNotDeprecatedFields(BibDatabaseMode mode)
getImportantOptionalFieldsback to summary
public SequencedSet<Field> getImportantOptionalFields()
getOptionalFieldsback to summary
public SequencedSet<BibField> getOptionalFields()
getOptionalFieldsAndAliasesback to summary
private SequencedSet<Field> getOptionalFieldsAndAliases()

Get list of all optional fields of this entry and all fields being source for a BibTeX to BibLaTeX conversion.

getRequiredFieldsback to summary
public SequencedSet<OrFields> getRequiredFields()

Returns all required field names. If fields have an OR relationship the name includes both field names divided by /, e.g. author/editor. If you need all required fields as sole entities use @see{getRequiredFieldsFlat} .

Returns:SequencedSet<OrFields>

a Set of required field name Strings

getTypeback to summary
public EntryType getType()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
isRequiredback to summary
public boolean isRequired(Field field)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Generates a single line string containing the information. This is used for debugging purposes. See "Effective Java, Item 10" for a discussion on contracts. We are sure, we are using this method in a) logs (which should use single lines for output) and b) in the UI. For the UI, we use org.jabref.gui.importer.BibEntryTypePrefsAndFileViewModel, which in turn uses serializeCustomEntryTypes(BibEntryType)

Annotations
@Override