Class Identifier

java.lang.Object
nl.siegmann.epublib.domain.Identifier
All Implemented Interfaces:
Serializable

public class Identifier extends Object implements Serializable
A Book's identifier. Defaults to a random UUID and scheme "UUID"
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • bookId

      private boolean bookId
    • scheme

      private String scheme
    • value

      private String value
  • Constructor Details

    • Identifier

      public Identifier()
      Creates an Identifier with as value a random UUID and scheme "UUID"
    • Identifier

      public Identifier(String scheme, String value)
  • Method Details

    • getBookIdIdentifier

      public static Identifier getBookIdIdentifier(List<Identifier> identifiers)
      The first identifier for which the bookId is true is made the bookId identifier. If no identifier has bookId == true then the first bookId identifier is written as the primary.
      Parameters:
      identifiers -
      Returns:
      The first identifier for which the bookId is true is made the bookId identifier.
    • getScheme

      public String getScheme()
    • setScheme

      public void setScheme(String scheme)
    • getValue

      public String getValue()
    • setValue

      public void setValue(String value)
    • setBookId

      public void setBookId(boolean bookId)
    • isBookId

      public boolean isBookId()
      This bookId property allows the book creator to add multiple ids and tell the epubwriter which one to write out as the bookId. The Dublin Core metadata spec allows multiple identifiers for a Book. The epub spec requires exactly one identifier to be marked as the book id.
      Returns:
      whether this is the unique book id.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object otherIdentifier)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object