Package nl.siegmann.epublib.domain
Class Identifier
- java.lang.Object
-
- nl.siegmann.epublib.domain.Identifier
-
- All Implemented Interfaces:
java.io.Serializable
public class Identifier extends java.lang.Object implements java.io.SerializableA 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 interfaceIdentifier.Scheme
-
Field Summary
Fields Modifier and Type Field Description private booleanbookIdprivate java.lang.Stringschemeprivate static longserialVersionUIDprivate java.lang.Stringvalue
-
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 booleanequals(java.lang.Object otherIdentifier)static IdentifiergetBookIdIdentifier(java.util.List<Identifier> identifiers)The first identifier for which the bookId is true is made the bookId identifier.java.lang.StringgetScheme()java.lang.StringgetValue()inthashCode()booleanisBookId()This bookId property allows the book creator to add multiple ids and tell the epubwriter which one to write out as the bookId.voidsetBookId(boolean bookId)voidsetScheme(java.lang.String scheme)voidsetValue(java.lang.String value)java.lang.StringtoString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
bookId
private boolean bookId
-
scheme
private java.lang.String scheme
-
value
private 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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object otherIdentifier)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-