/** * Parses a {@link ProtocolAppliedWaveletDelta}. Convenience method, equivalent to * {@code from(ProtocolAppliedWaveletDelta.getDefaultInstanceForType(), byteString)}. */ public static ByteStringMessage<ProtocolAppliedWaveletDelta> parseProtocolAppliedWaveletDelta( ByteString byteString) throws InvalidProtocolBufferException { return new ByteStringMessage<ProtocolAppliedWaveletDelta>( ProtocolAppliedWaveletDelta.parseFrom(byteString), byteString); }
/** * Parses a {@link ProtocolWaveletDelta}. Convenience method, equivalent to * {@code from(ProtocolWaveletDelta.getDefaultInstanceForType(), byteString)}. */ public static ByteStringMessage<ProtocolWaveletDelta> parseProtocolWaveletDelta( ByteString byteString) throws InvalidProtocolBufferException { return new ByteStringMessage<ProtocolWaveletDelta>( ProtocolWaveletDelta.parseFrom(byteString), byteString); }
/** * Serialises a {@link Message} into a {@link ByteStringMessage}. * This should only be used once, when the message is originally created. * * @param message to form the serialised version of */ public static <K extends Message> ByteStringMessage<K> serializeMessage(K message) { return new ByteStringMessage<K>(message, message.toByteString()); }
/** * Parses a {@link ByteStringMessage} from its {@link ByteString} * representation. * * @param prototype used to create a {@link Message.Builder} to parse the * message * @param byteString representation of the message * @throws InvalidProtocolBufferException if {@code byteString} is not a * valid protocol buffer */ public static <K extends Message> ByteStringMessage<K> parseFrom(K prototype, ByteString byteString) throws InvalidProtocolBufferException { return new ByteStringMessage<K>(parse(prototype, byteString), byteString); }