Package org.greenbytes.http.sfv
Class ByteSequenceItem
- java.lang.Object
-
- org.greenbytes.http.sfv.ByteSequenceItem
-
- All Implemented Interfaces:
Supplier<ByteBuffer>,Item<ByteBuffer>,ListElement<ByteBuffer>,Parameterizable<ByteBuffer>,Type<ByteBuffer>
public class ByteSequenceItem extends Object implements Item<ByteBuffer>
Represents a Byte Sequence.- See Also:
- Section 3.3.5 of RFC 9651
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBufferget()ParametersgetParams()Get theParametersof thisItem.Stringserialize()Serialize.StringBuilderserializeTo(StringBuilder sb)Serialize to an existingStringBuilder.static ByteSequenceItemvalueOf(byte[] value)Creates aByteSequenceIteminstance representing the specifiedbyte[]value.ByteSequenceItemwithParams(Parameters params)Given an existingItem, return a new instance with the specifiedParameters.
-
-
-
Method Detail
-
valueOf
public static ByteSequenceItem valueOf(byte[] value)
Creates aByteSequenceIteminstance representing the specifiedbyte[]value.- Parameters:
value- abyte[]value.- Returns:
- a
ByteSequenceItemrepresentingvalue.
-
withParams
public ByteSequenceItem withParams(Parameters params)
Description copied from interface:ParameterizableGiven an existingItem, return a new instance with the specifiedParameters.- Specified by:
withParamsin interfaceItem<ByteBuffer>- Specified by:
withParamsin interfaceParameterizable<ByteBuffer>- Parameters:
params-Parametersto set (must be non-null)- Returns:
- new instance with specified
Parameters.
-
getParams
public Parameters getParams()
Description copied from interface:ParameterizableGet theParametersof thisItem.- Specified by:
getParamsin interfaceParameterizable<ByteBuffer>- Returns:
- the parameters.
-
serializeTo
public StringBuilder serializeTo(StringBuilder sb)
Description copied from interface:TypeSerialize to an existingStringBuilder.- Specified by:
serializeToin interfaceType<ByteBuffer>- Parameters:
sb- where to serialize to- Returns:
- the
StringBuilderso calls can be chained.
-
serialize
public String serialize()
Description copied from interface:TypeSerialize.- Specified by:
serializein interfaceType<ByteBuffer>- Returns:
- the serialization.
-
get
public ByteBuffer get()
- Specified by:
getin interfaceSupplier<ByteBuffer>
-
-