Class CborCodec
java.lang.Object
ai.badmonkey.agentspaces.common.codec.CborCodec
The canonical AgentSpaces codec: CBOR (RFC 8949) for all wire payloads and entry
serialization, with a JSON view for logs and debugging. Records serialize in
declared component order, which is the v0.1 canonical form that advertisement
signatures are computed over.
Unknown fields are ignored on read, so a v0.1 peer tolerates cards and entries from newer peers that add fields.
-
Method Summary
Modifier and TypeMethodDescriptionstatic CborCodecReturns the shared default codec.<T> TDeserializes CBOR bytes into the given type.byte[]Serializes a value to canonical CBOR bytes.Renders a value as JSON, for logs and debugging only.
-
Method Details
-
defaultCodec
Returns the shared default codec. -
toBytes
Serializes a value to canonical CBOR bytes.- Parameters:
value- the value to serialize- Returns:
- the CBOR encoding
-
fromBytes
Deserializes CBOR bytes into the given type.- Type Parameters:
T- the target type- Parameters:
bytes- the CBOR encodingtype- the target type- Returns:
- the deserialized value
-
toJson
-