Class ExTermEncoder
java.lang.Object
net.dv8tion.jda.api.utils.data.etf.ExTermEncoder
Encodes an object into a binary ETF representation.
- Since:
- 4.2.1
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ByteBufferEncodes the provided object into an ETF buffer.
-
Constructor Details
-
ExTermEncoder
public ExTermEncoder()
-
-
Method Details
-
pack
Encodes the provided object into an ETF buffer.The mapping is as follows:
String -> BinaryMap -> MapCollection -> List | NILByte -> Small IntInteger, Short -> Int | Small IntLong -> Small BigInt | Int | Small IntFloat, Double -> New FloatBoolean -> Atom(Boolean)null -> Atom("nil")
- Parameters:
data- The object to encode- Returns:
ByteBufferwith the encoded ETF term- Throws:
UnsupportedOperationException- If there is no type mapping for the provided object
-