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 Type
    Method
    Description
    Returns the descriptor for the inner payload that was signed/encrypted, or null if this step does not carry a nested payload.
    com.google.protobuf.Message
    parseFrom(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.Message
    toProtobuf(Object javaObj)
    Converts a Java object (as produced by the role code) into a Protobuf message of the step-specific type.
  • Method Details

    • toProtobuf

      com.google.protobuf.Message toProtobuf(Object javaObj) throws IOException
      Converts a Java object (as produced by the role code) into a Protobuf message of the step-specific type.
      Parameters:
      javaObj - the Java object (never null)
      Returns:
      the corresponding Protobuf message
      Throws:
      IOException - if conversion fails
    • parseFrom

      com.google.protobuf.Message parseFrom(byte[] data) throws IOException
      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

      Object toJavaObject(com.google.protobuf.Message protoMsg) throws IOException
      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

      default Channel_ProtobufSerializer.StepDescriptor getInnerPayloadDescriptor()
      Returns the descriptor for the inner payload that was signed/encrypted, or null if this step does not carry a nested payload.
      Returns:
      the inner payload descriptor, or null