Package org.apache.bookkeeper.util
Class LedgerIdFormatter
- java.lang.Object
-
- org.apache.bookkeeper.util.LedgerIdFormatter
-
- Direct Known Subclasses:
LedgerIdFormatter.HexLedgerIdFormatter
,LedgerIdFormatter.LongLedgerIdFormatter
,LedgerIdFormatter.UUIDLedgerIdFormatter
public abstract class LedgerIdFormatter extends java.lang.Object
Formatter to format a ledgerId.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LedgerIdFormatter.HexLedgerIdFormatter
hex ledgerId formatter.static class
LedgerIdFormatter.LongLedgerIdFormatter
long ledgerId formatter.static class
LedgerIdFormatter.UUIDLedgerIdFormatter
uuid ledgerId formatter.
-
Field Summary
Fields Modifier and Type Field Description static LedgerIdFormatter
LONG_LEDGERID_FORMATTER
-
Constructor Summary
Constructors Constructor Description LedgerIdFormatter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.lang.String
formatLedgerId(long ledgerId)
Formats the LedgerId according to the type of the Formatter and return it in String format.static LedgerIdFormatter
newLedgerIdFormatter(java.lang.String opt, AbstractConfiguration conf)
static LedgerIdFormatter
newLedgerIdFormatter(AbstractConfiguration<?> conf)
abstract long
readLedgerId(java.lang.String ledgerIdString)
converts the ledgeridString, which is in format of the type of formatter, to the long value.
-
-
-
Field Detail
-
LONG_LEDGERID_FORMATTER
public static final LedgerIdFormatter LONG_LEDGERID_FORMATTER
-
-
Method Detail
-
formatLedgerId
public abstract java.lang.String formatLedgerId(long ledgerId)
Formats the LedgerId according to the type of the Formatter and return it in String format.- Parameters:
ledgerId
-- Returns:
-
readLedgerId
public abstract long readLedgerId(java.lang.String ledgerIdString)
converts the ledgeridString, which is in format of the type of formatter, to the long value.- Parameters:
ledgerIdString
-- Returns:
-
newLedgerIdFormatter
public static LedgerIdFormatter newLedgerIdFormatter(AbstractConfiguration<?> conf)
-
newLedgerIdFormatter
public static LedgerIdFormatter newLedgerIdFormatter(java.lang.String opt, AbstractConfiguration conf)
-
-