Package com.yahoo.document.idstring
Class IdString
- java.lang.Object
-
- com.yahoo.document.idstring.IdString
-
- Direct Known Subclasses:
IdIdString
public abstract class IdString extends java.lang.Object
To be used with DocumentId constructor.- Author:
- Einar M R Rosenvinge
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IdString.Scheme
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_LENGTH
-
Constructor Summary
Constructors Modifier Constructor Description protected
IdString(IdString.Scheme scheme, java.lang.String namespace, java.lang.String namespaceSpecific)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static IdString
createFromSerialized(java.lang.String id)
Creates a IdString based on the given serialized document id string.static IdString
createIdString(java.lang.String id)
Creates a IdString based on the given document id string.static IdString
createIdStringLessStrict(java.lang.String id)
Creates a IdString based on the given document id string.boolean
equals(java.lang.Object o)
java.lang.String
getDocType()
java.lang.String
getGroup()
abstract long
getLocation()
java.lang.String
getNamespace()
java.lang.String
getNamespaceSpecific()
long
getNumber()
java.lang.String
getSchemeParameters()
abstract java.lang.String
getSchemeSpecific()
IdString.Scheme
getType()
boolean
hasDocType()
boolean
hasGroup()
int
hashCode()
boolean
hasNumber()
java.lang.String
toString()
com.yahoo.text.Utf8String
toUtf8()
-
-
-
Field Detail
-
MAX_LENGTH
public static final int MAX_LENGTH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
IdString
protected IdString(IdString.Scheme scheme, java.lang.String namespace, java.lang.String namespaceSpecific)
-
-
Method Detail
-
hasDocType
public boolean hasDocType()
-
getDocType
public java.lang.String getDocType()
-
hasGroup
public boolean hasGroup()
-
hasNumber
public boolean hasNumber()
-
getNumber
public long getNumber()
-
getGroup
public java.lang.String getGroup()
-
createIdString
public static IdString createIdString(java.lang.String id)
Creates a IdString based on the given document id string. The document id string can only contain text characters.
-
createIdStringLessStrict
@Beta public static IdString createIdStringLessStrict(java.lang.String id)
Creates a IdString based on the given document id string. This is a less strict variant for creating 'illegal' document ids for documents already fed. Only use when strictly needed.
-
createFromSerialized
public static IdString createFromSerialized(java.lang.String id)
Creates a IdString based on the given serialized document id string. The document id string can not contain 0x0 byte characters.
-
getType
public IdString.Scheme getType()
-
getNamespace
public java.lang.String getNamespace()
-
getNamespaceSpecific
public java.lang.String getNamespaceSpecific()
-
getLocation
public abstract long getLocation()
-
getSchemeParameters
public java.lang.String getSchemeParameters()
-
getSchemeSpecific
public abstract java.lang.String getSchemeSpecific()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toUtf8
public com.yahoo.text.Utf8String toUtf8()
-
-