/** * <code>optional .openxc.CommandResponse command_response = 6;</code> */ public Builder setCommandResponse( com.openxc.BinaryMessages.CommandResponse.Builder builderForValue) { if (commandResponseBuilder_ == null) { commandResponse_ = builderForValue.build(); onChanged(); } else { commandResponseBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000020; return this; } /**
subBuilder.mergeFrom(commandResponse_); commandResponse_ = subBuilder.buildPartial();
/** * <code>optional string message = 2;</code> */ public Builder setMessage( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000002; message_ = value; onChanged(); return this; } /**
BinaryMessages.CommandResponse.newBuilder(); if(message.getCommand().equals(CommandType.VERSION)) { messageBuilder.setType(BinaryMessages.ControlCommand.Type.VERSION); } else if(message.getCommand().equals(CommandType.DEVICE_ID)) { messageBuilder.setType(BinaryMessages.ControlCommand.Type.DEVICE_ID); } else if(message.getCommand().equals(CommandType.PLATFORM)) { messageBuilder.setType(BinaryMessages.ControlCommand.Type.PLATFORM); } else if(message.getCommand().equals(CommandType.PASSTHROUGH)) { messageBuilder.setType(BinaryMessages.ControlCommand.Type.PASSTHROUGH); } else if(message.getCommand().equals(CommandType.AF_BYPASS)) { messageBuilder.setType(BinaryMessages.ControlCommand.Type.ACCEPTANCE_FILTER_BYPASS); } else if(message.getCommand().equals(CommandType.PAYLOAD_FORMAT)) { messageBuilder.setType(BinaryMessages.ControlCommand.Type.PAYLOAD_FORMAT); } else if(message.getCommand().equals(CommandType.SD_MOUNT_STATUS)) { messageBuilder.setType(BinaryMessages.ControlCommand.Type.SD_MOUNT_STATUS); } else if(message.getCommand().equals(CommandType.RTC_CONFIGURATION)) { messageBuilder.setType(BinaryMessages.ControlCommand.Type.RTC_CONFIGURATION); } else if(message.getCommand().equals(CommandType.DIAGNOSTIC_REQUEST)) { messageBuilder.setType(BinaryMessages.ControlCommand.Type.DIAGNOSTIC); } else { throw new SerializationException( messageBuilder.setStatus(message.getStatus()); messageBuilder.setMessage(message.getMessage());
/** * <code>optional .openxc.CommandResponse command_response = 6;</code> */ public Builder mergeCommandResponse(com.openxc.BinaryMessages.CommandResponse value) { if (commandResponseBuilder_ == null) { if (((bitField0_ & 0x00000020) == 0x00000020) && commandResponse_ != null && commandResponse_ != com.openxc.BinaryMessages.CommandResponse.getDefaultInstance()) { commandResponse_ = com.openxc.BinaryMessages.CommandResponse.newBuilder(commandResponse_).mergeFrom(value).buildPartial(); } else { commandResponse_ = value; } onChanged(); } else { commandResponseBuilder_.mergeFrom(value); } bitField0_ |= 0x00000020; return this; } /**
public com.openxc.BinaryMessages.CommandResponse buildPartial() { com.openxc.BinaryMessages.CommandResponse result = new com.openxc.BinaryMessages.CommandResponse(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.type_ = type_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.message_ = message_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } result.status_ = status_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.openxc.BinaryMessages.CommandResponse parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.openxc.BinaryMessages.CommandResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
public Builder mergeFrom(com.openxc.BinaryMessages.CommandResponse other) { if (other == com.openxc.BinaryMessages.CommandResponse.getDefaultInstance()) return this; if (other.hasType()) { setType(other.getType()); } if (other.hasMessage()) { bitField0_ |= 0x00000002; message_ = other.message_; onChanged(); } if (other.hasStatus()) { setStatus(other.getStatus()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
private Builder() { maybeForceBuilderInitialization(); }
/** * <code>optional string message = 2;</code> */ public Builder setMessageBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000002; message_ = value; onChanged(); return this; }
public static Builder newBuilder(com.openxc.BinaryMessages.CommandResponse prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } public Builder toBuilder() {
/** * <code>optional .openxc.ControlCommand.Type type = 1;</code> */ public Builder setType(com.openxc.BinaryMessages.ControlCommand.Type value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000001; type_ = value.getNumber(); onChanged(); return this; } /**
/** * <code>optional bool status = 3;</code> */ public Builder setStatus(boolean value) { bitField0_ |= 0x00000004; status_ = value; onChanged(); return this; } /**
/** * <code>optional .openxc.ControlCommand.Type type = 1;</code> */ public Builder clearType() { bitField0_ = (bitField0_ & ~0x00000001); type_ = 1; onChanged(); return this; }
public com.openxc.BinaryMessages.CommandResponse build() { com.openxc.BinaryMessages.CommandResponse result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
/** * <code>optional bool status = 3;</code> */ public Builder clearStatus() { bitField0_ = (bitField0_ & ~0x00000004); status_ = false; onChanged(); return this; } public final Builder setUnknownFields(
public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.openxc.BinaryMessages.CommandResponse) { return mergeFrom((com.openxc.BinaryMessages.CommandResponse)other); } else { super.mergeFrom(other); return this; } }
private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() {
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**