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.ObjectFormatter to format a ledgerId.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLedgerIdFormatter.HexLedgerIdFormatterhex ledgerId formatter.static classLedgerIdFormatter.LongLedgerIdFormatterlong ledgerId formatter.static classLedgerIdFormatter.UUIDLedgerIdFormatteruuid ledgerId formatter.
-
Field Summary
Fields Modifier and Type Field Description static LedgerIdFormatterLONG_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.StringformatLedgerId(long ledgerId)Formats the LedgerId according to the type of the Formatter and return it in String format.static LedgerIdFormatternewLedgerIdFormatter(java.lang.String opt, AbstractConfiguration conf)static LedgerIdFormatternewLedgerIdFormatter(AbstractConfiguration<?> conf)abstract longreadLedgerId(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)
-
-