All Downloads are FREE. Search and download functionalities are using the official Maven repository.

protobuf_unittest.Engine Maven / Gradle / Ivy

The newest version!
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: com/google/protobuf/nested_builders_test.proto

package protobuf_unittest;

/**
 * Protobuf type {@code protobuf_unittest.Engine}
 */
public final class Engine extends
    com.google.protobuf.GeneratedMessage implements
    // @@protoc_insertion_point(message_implements:protobuf_unittest.Engine)
    EngineOrBuilder {
  // Use Engine.newBuilder() to construct.
  private Engine(com.google.protobuf.GeneratedMessage.Builder builder) {
    super(builder);
    this.unknownFields = builder.getUnknownFields();
  }
  private Engine(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

  private static final Engine defaultInstance;
  public static Engine getDefaultInstance() {
    return defaultInstance;
  }

  public Engine getDefaultInstanceForType() {
    return defaultInstance;
  }

  private final com.google.protobuf.UnknownFieldSet unknownFields;
  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
      getUnknownFields() {
    return this.unknownFields;
  }
  private Engine(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    initFields();
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          default: {
            if (!parseUnknownField(input, unknownFields,
                                   extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
          case 8: {
            bitField0_ |= 0x00000001;
            cylinder_ = input.readInt32();
            break;
          }
          case 16: {
            bitField0_ |= 0x00000002;
            liters_ = input.readInt32();
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e.getMessage()).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return protobuf_unittest.NestedBuilders.internal_static_protobuf_unittest_Engine_descriptor;
  }

  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return protobuf_unittest.NestedBuilders.internal_static_protobuf_unittest_Engine_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            protobuf_unittest.Engine.class, protobuf_unittest.Engine.Builder.class);
  }

  public static com.google.protobuf.Parser PARSER =
      new com.google.protobuf.AbstractParser() {
    public Engine parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new Engine(input, extensionRegistry);
    }
  };

  @java.lang.Override
  public com.google.protobuf.Parser getParserForType() {
    return PARSER;
  }

  private int bitField0_;
  public static final int CYLINDER_FIELD_NUMBER = 1;
  private int cylinder_;
  /**
   * optional int32 cylinder = 1;
   */
  public boolean hasCylinder() {
    return ((bitField0_ & 0x00000001) == 0x00000001);
  }
  /**
   * optional int32 cylinder = 1;
   */
  public int getCylinder() {
    return cylinder_;
  }

  public static final int LITERS_FIELD_NUMBER = 2;
  private int liters_;
  /**
   * optional int32 liters = 2;
   */
  public boolean hasLiters() {
    return ((bitField0_ & 0x00000002) == 0x00000002);
  }
  /**
   * optional int32 liters = 2;
   */
  public int getLiters() {
    return liters_;
  }

  private void initFields() {
    cylinder_ = 0;
    liters_ = 0;
  }
  private byte memoizedIsInitialized = -1;
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    getSerializedSize();
    if (((bitField0_ & 0x00000001) == 0x00000001)) {
      output.writeInt32(1, cylinder_);
    }
    if (((bitField0_ & 0x00000002) == 0x00000002)) {
      output.writeInt32(2, liters_);
    }
    getUnknownFields().writeTo(output);
  }

  private int memoizedSerializedSize = -1;
  public int getSerializedSize() {
    int size = memoizedSerializedSize;
    if (size != -1) return size;

    size = 0;
    if (((bitField0_ & 0x00000001) == 0x00000001)) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(1, cylinder_);
    }
    if (((bitField0_ & 0x00000002) == 0x00000002)) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(2, liters_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSerializedSize = size;
    return size;
  }

  private static final long serialVersionUID = 0L;
  @java.lang.Override
  protected java.lang.Object writeReplace()
      throws java.io.ObjectStreamException {
    return super.writeReplace();
  }

  public static protobuf_unittest.Engine parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static protobuf_unittest.Engine parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static protobuf_unittest.Engine parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static protobuf_unittest.Engine parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static protobuf_unittest.Engine parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return PARSER.parseFrom(input);
  }
  public static protobuf_unittest.Engine parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return PARSER.parseFrom(input, extensionRegistry);
  }
  public static protobuf_unittest.Engine parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return PARSER.parseDelimitedFrom(input);
  }
  public static protobuf_unittest.Engine parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return PARSER.parseDelimitedFrom(input, extensionRegistry);
  }
  public static protobuf_unittest.Engine parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return PARSER.parseFrom(input);
  }
  public static protobuf_unittest.Engine parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return PARSER.parseFrom(input, extensionRegistry);
  }

  public static Builder newBuilder() { return Builder.create(); }
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder(protobuf_unittest.Engine prototype) {
    return newBuilder().mergeFrom(prototype);
  }
  public Builder toBuilder() { return newBuilder(this); }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessage.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * Protobuf type {@code protobuf_unittest.Engine}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessage.Builder implements
      // @@protoc_insertion_point(builder_implements:protobuf_unittest.Engine)
      protobuf_unittest.EngineOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return protobuf_unittest.NestedBuilders.internal_static_protobuf_unittest_Engine_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return protobuf_unittest.NestedBuilders.internal_static_protobuf_unittest_Engine_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              protobuf_unittest.Engine.class, protobuf_unittest.Engine.Builder.class);
    }

    // Construct using protobuf_unittest.Engine.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
      }
    }
    private static Builder create() {
      return new Builder();
    }

    public Builder clear() {
      super.clear();
      cylinder_ = 0;
      bitField0_ = (bitField0_ & ~0x00000001);
      liters_ = 0;
      bitField0_ = (bitField0_ & ~0x00000002);
      return this;
    }

    public Builder clone() {
      return create().mergeFrom(buildPartial());
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return protobuf_unittest.NestedBuilders.internal_static_protobuf_unittest_Engine_descriptor;
    }

    public protobuf_unittest.Engine getDefaultInstanceForType() {
      return protobuf_unittest.Engine.getDefaultInstance();
    }

    public protobuf_unittest.Engine build() {
      protobuf_unittest.Engine result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public protobuf_unittest.Engine buildPartial() {
      protobuf_unittest.Engine result = new protobuf_unittest.Engine(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
        to_bitField0_ |= 0x00000001;
      }
      result.cylinder_ = cylinder_;
      if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
        to_bitField0_ |= 0x00000002;
      }
      result.liters_ = liters_;
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof protobuf_unittest.Engine) {
        return mergeFrom((protobuf_unittest.Engine)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(protobuf_unittest.Engine other) {
      if (other == protobuf_unittest.Engine.getDefaultInstance()) return this;
      if (other.hasCylinder()) {
        setCylinder(other.getCylinder());
      }
      if (other.hasLiters()) {
        setLiters(other.getLiters());
      }
      this.mergeUnknownFields(other.getUnknownFields());
      return this;
    }

    public final boolean isInitialized() {
      return true;
    }

    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      protobuf_unittest.Engine parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (protobuf_unittest.Engine) e.getUnfinishedMessage();
        throw e;
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private int cylinder_ ;
    /**
     * optional int32 cylinder = 1;
     */
    public boolean hasCylinder() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * optional int32 cylinder = 1;
     */
    public int getCylinder() {
      return cylinder_;
    }
    /**
     * optional int32 cylinder = 1;
     */
    public Builder setCylinder(int value) {
      bitField0_ |= 0x00000001;
      cylinder_ = value;
      onChanged();
      return this;
    }
    /**
     * optional int32 cylinder = 1;
     */
    public Builder clearCylinder() {
      bitField0_ = (bitField0_ & ~0x00000001);
      cylinder_ = 0;
      onChanged();
      return this;
    }

    private int liters_ ;
    /**
     * optional int32 liters = 2;
     */
    public boolean hasLiters() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * optional int32 liters = 2;
     */
    public int getLiters() {
      return liters_;
    }
    /**
     * optional int32 liters = 2;
     */
    public Builder setLiters(int value) {
      bitField0_ |= 0x00000002;
      liters_ = value;
      onChanged();
      return this;
    }
    /**
     * optional int32 liters = 2;
     */
    public Builder clearLiters() {
      bitField0_ = (bitField0_ & ~0x00000002);
      liters_ = 0;
      onChanged();
      return this;
    }

    // @@protoc_insertion_point(builder_scope:protobuf_unittest.Engine)
  }

  static {
    defaultInstance = new Engine(true);
    defaultInstance.initFields();
  }

  // @@protoc_insertion_point(class_scope:protobuf_unittest.Engine)
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy