Package anbxj
Interface Channel_ProtobufSerializer.StepDescriptor
- All Known Subinterfaces:
Channel_ProtobufSerializer.StepPayloadDescriptor
- All Known Implementing Classes:
Channel_ProtobufSerializer.OpaqueStepDescriptor
- Enclosing class:
Channel_ProtobufSerializer
public static interface Channel_ProtobufSerializer.StepDescriptor
Descriptor that handles a single protocol step.
Implementations are typically generated by the AnBx compiler for each step.
They know the exact Protobuf message type (e.g., Step1_AliceToBob)
and how to convert between that message and the corresponding Java object.
Descendants that carry a user-defined payload should implement
Channel_ProtobufSerializer.StepPayloadDescriptor instead, which adds payload-building and
field-extraction methods.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the descriptor for the inner payload that was signed/encrypted, ornullif this step does not carry a nested payload.com.google.protobuf.MessageparseFrom(byte[] data) Parses a byte array into the step-specific Protobuf message.toJavaObject(com.google.protobuf.Message protoMsg) Reconstructs the Java object that the role code expects from the parsed Protobuf message.com.google.protobuf.MessagetoProtobuf(Object javaObj) Converts a Java object (as produced by the role code) into a Protobuf message of the step-specific type.
-
Method Details
-
toProtobuf
Converts a Java object (as produced by the role code) into a Protobuf message of the step-specific type.- Parameters:
javaObj- the Java object (nevernull)- Returns:
- the corresponding Protobuf message
- Throws:
IOException- if conversion fails
-
parseFrom
Parses a byte array into the step-specific Protobuf message.- Parameters:
data- the raw bytes received from the network- Returns:
- the parsed Protobuf message
- Throws:
IOException- if parsing fails
-
toJavaObject
Reconstructs the Java object that the role code expects from the parsed Protobuf message.- Parameters:
protoMsg- the parsed Protobuf message- Returns:
- the corresponding Java object
- Throws:
IOException- if reconstruction fails
-
getInnerPayloadDescriptor
Returns the descriptor for the inner payload that was signed/encrypted, ornullif this step does not carry a nested payload.- Returns:
- the inner payload descriptor, or
null
-