Class Identifier

  • All Implemented Interfaces:
    java.io.Serializable

    public class Identifier
    extends java.lang.Object
    implements java.io.Serializable
    A Book's identifier. Defaults to a random UUID and scheme "UUID"
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  Identifier.Scheme  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean bookId  
      private java.lang.String scheme  
      private static long serialVersionUID  
      private java.lang.String value  
    • Constructor Summary

      Constructors 
      Constructor Description
      Identifier()
      Creates an Identifier with as value a random UUID and scheme "UUID"
      Identifier​(java.lang.String scheme, java.lang.String value)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object otherIdentifier)  
      static Identifier getBookIdIdentifier​(java.util.List<Identifier> identifiers)
      The first identifier for which the bookId is true is made the bookId identifier.
      java.lang.String getScheme()  
      java.lang.String getValue()  
      int hashCode()  
      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.
      void setBookId​(boolean bookId)  
      void setScheme​(java.lang.String scheme)  
      void setValue​(java.lang.String value)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • bookId

        private boolean bookId
      • scheme

        private java.lang.String scheme
      • value

        private java.lang.String value
    • Constructor Detail

      • Identifier

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

        public Identifier​(java.lang.String scheme,
                          java.lang.String value)
    • Method Detail

      • getBookIdIdentifier

        public static Identifier getBookIdIdentifier​(java.util.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 java.lang.String getScheme()
      • setScheme

        public void setScheme​(java.lang.String scheme)
      • getValue

        public java.lang.String getValue()
      • setValue

        public void setValue​(java.lang.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 java.lang.Object
      • equals

        public boolean equals​(java.lang.Object otherIdentifier)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object