Package zipkin2.codec
Interface BytesDecoder<T>
- Type Parameters:
T- type of the object to deserialize
- All Known Implementing Classes:
DependencyLinkBytesDecoder,SpanBytesDecoder
public interface BytesDecoder<T>
This type accepts a collection that receives decoded elements.
ArrayList<Span> out = new ArrayList<>();
SpanBytesDecoder.JSON_V2.decodeList(spans, out)
-
Method Summary
Modifier and Type Method Description booleandecode(byte[] serialized, Collection<T> out)This is used seldomly as the canonical message form is alist.List<T>decodeList(byte[] serialized)Convenience method fordecodeList(byte[], Collection)booleandecodeList(byte[] serialized, Collection<T> out)TdecodeOne(byte[] serialized)Visible for testing.Encodingencoding()
-
Method Details
-
encoding
Encoding encoding() -
decode
This is used seldomly as the canonical message form is alist.Note: multiple elements can be consumed from a single serialized object. For example, if the input is Zipkin v1, the list might receive two elements if the serialized object was a shared span.
- Parameters:
serialized- a single message, for example a json object- Returns:
- true if an element was decoded
-
decodeOne
Visible for testing. This returns the first element parsed from the serialized object or null -
decodeList
- Returns:
- true if an element was decoded
-
decodeList
Convenience method fordecodeList(byte[], Collection)
-