public final class PageKey extends Object
Constructor and Description |
---|
PageKey(String key)
Creates a new instance from a raw string, which is expected to contain 3 parts, each representing a piece of information
|
PageKey(String parentId,
String offset,
long blockSize)
Creates a new page key instance passing in each individual page component
|
Modifier and Type | Method and Description |
---|---|
long |
getBlockSize()
Returns the size of the block
|
Integer |
getOffsetInt()
Returns the integer representation of the offset, if the offset is convertible to an integer.
|
String |
getOffsetString()
Returns the offset of the block, which semantically represents a pointer to the start of the block.
|
String |
getParentId()
Returns the id of the document which owns the block and effectively the list of children,
|
static boolean |
isValidFormat(String string)
Checks if the given string is a valid
PageKey format. |
String |
toString() |
PageKey |
withParentId(String parentId)
Creates a new
PageKey instance which has the given parent ID and the same
offset & block size as this page. |
public PageKey(String key)
key
- a non-null
stringIllegalArgumentException
- if the string is not correctly formed.public PageKey(String parentId, String offset, long blockSize)
parentId
- the id of the parent node; may not be null
offset
- the offset of the page withing the total list of children; may not be null
blockSize
- the number of children in a page.public PageKey withParentId(String parentId)
PageKey
instance which has the given parent ID and the same
offset & block size as this page.public long getBlockSize()
public String getOffsetString()
non-null
Stringpublic Integer getOffsetInt()
null
is returned.public String getParentId()
non-null
Stringpublic static boolean isValidFormat(String string)
PageKey
format.Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.