public abstract class BagKey extends java.lang.Object implements java.lang.Comparable<BagKey>
A BagKey
is used to look up data items and child bags within a baggage instance.
BagKey instances should be created with the static methods indexed
and keyed
. As per the Baggage
protocol, fields can either be keyed (using arbitrary bytes) or indexed (with an unsigned integer). Indexes for
fields are statically assigned for efficiency in more established protocols. It is recommended to use named keys for
ad-hoc data.
Modifier and Type | Class and Description |
---|---|
static class |
BagKey.Indexed
An Indexed BagKey is one that uses an integer as identifier (versus arbitrary bytes for a
BagKey.Keyed key) |
static class |
BagKey.Keyed
A Keyed BagKey is one that uses arbitrary bytes as identifier (versus an integer for
BagKey.Indexed key) |
Modifier and Type | Field and Description |
---|---|
BagOptions |
options |
Modifier and Type | Method and Description |
---|---|
abstract java.nio.ByteBuffer |
atomPayload() |
abstract AtomPrefixes.AtomPrefix |
atomPrefix(int level,
BagOptions options) |
static BagKey |
indexed(int index) |
static BagKey |
indexed(int index,
BagOptions options) |
static BagKey |
keyed(java.nio.ByteBuffer key) |
static BagKey |
keyed(java.nio.ByteBuffer key,
BagOptions options) |
static BagKey |
keyed(java.lang.String name,
BagOptions options) |
static BagKey |
named(java.lang.String name) |
public final BagOptions options
public abstract AtomPrefixes.AtomPrefix atomPrefix(int level, BagOptions options)
public abstract java.nio.ByteBuffer atomPayload()
public static BagKey indexed(int index)
public static BagKey indexed(int index, BagOptions options)
public static BagKey named(java.lang.String name)
public static BagKey keyed(java.lang.String name, BagOptions options)
public static BagKey keyed(java.nio.ByteBuffer key)
public static BagKey keyed(java.nio.ByteBuffer key, BagOptions options)