Package io.opencensus.tags
Class NoopTags.NoopTagContextBinarySerializer
- java.lang.Object
-
- io.opencensus.tags.propagation.TagContextBinarySerializer
-
- io.opencensus.tags.NoopTags.NoopTagContextBinarySerializer
-
- Enclosing class:
- NoopTags
@Immutable private static final class NoopTags.NoopTagContextBinarySerializer extends TagContextBinarySerializer
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static byte[]EMPTY_BYTE_ARRAY(package private) static TagContextBinarySerializerINSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description privateNoopTagContextBinarySerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TagContextfromByteArray(byte[] bytes)Creates aTagContextfrom the given on-the-wire encoded representation.byte[]toByteArray(TagContext tags)Serializes theTagContextinto the on-the-wire representation.
-
-
-
Field Detail
-
INSTANCE
static final TagContextBinarySerializer INSTANCE
-
EMPTY_BYTE_ARRAY
static final byte[] EMPTY_BYTE_ARRAY
-
-
Method Detail
-
toByteArray
public byte[] toByteArray(TagContext tags)
Description copied from class:TagContextBinarySerializerSerializes theTagContextinto the on-the-wire representation.This method should be the inverse of
TagContextBinarySerializer.fromByteArray(byte[]).Tags that have aTagMetadatawithTagMetadata.TagTtl.NO_PROPAGATIONwill not be serialized.- Specified by:
toByteArrayin classTagContextBinarySerializer- Parameters:
tags- theTagContextto serialize.- Returns:
- the on-the-wire representation of a
TagContext.
-
fromByteArray
public TagContext fromByteArray(byte[] bytes)
Description copied from class:TagContextBinarySerializerCreates aTagContextfrom the given on-the-wire encoded representation.This method should be the inverse of
TagContextBinarySerializer.toByteArray(io.opencensus.tags.TagContext).- Specified by:
fromByteArrayin classTagContextBinarySerializer- Parameters:
bytes- on-the-wire representation of aTagContext.- Returns:
- a
TagContextdeserialized frombytes.
-
-