// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: frc_gazebo_plugin/msgs/joystick.proto

package gazebo.msgs;

public final class GzJoystick {
  private GzJoystick() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
  }
  public interface JoystickOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // repeated double axes = 1;
    /**
     * <code>repeated double axes = 1;</code>
     */
    java.util.List<java.lang.Double> getAxesList();
    /**
     * <code>repeated double axes = 1;</code>
     */
    int getAxesCount();
    /**
     * <code>repeated double axes = 1;</code>
     */
    double getAxes(int index);

    // repeated bool buttons = 2;
    /**
     * <code>repeated bool buttons = 2;</code>
     */
    java.util.List<java.lang.Boolean> getButtonsList();
    /**
     * <code>repeated bool buttons = 2;</code>
     */
    int getButtonsCount();
    /**
     * <code>repeated bool buttons = 2;</code>
     */
    boolean getButtons(int index);
  }
  /**
   * Protobuf type {@code gazebo.msgs.Joystick}
   */
  public static final class Joystick extends
      com.google.protobuf.GeneratedMessage
      implements JoystickOrBuilder {
    // Use Joystick.newBuilder() to construct.
    private Joystick(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private Joystick(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

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

    public Joystick getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private Joystick(
        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 9: {
              if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
                axes_ = new java.util.ArrayList<java.lang.Double>();
                mutable_bitField0_ |= 0x00000001;
              }
              axes_.add(input.readDouble());
              break;
            }
            case 10: {
              int length = input.readRawVarint32();
              int limit = input.pushLimit(length);
              if (!((mutable_bitField0_ & 0x00000001) == 0x00000001) && input.getBytesUntilLimit() > 0) {
                axes_ = new java.util.ArrayList<java.lang.Double>();
                mutable_bitField0_ |= 0x00000001;
              }
              while (input.getBytesUntilLimit() > 0) {
                axes_.add(input.readDouble());
              }
              input.popLimit(limit);
              break;
            }
            case 16: {
              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
                buttons_ = new java.util.ArrayList<java.lang.Boolean>();
                mutable_bitField0_ |= 0x00000002;
              }
              buttons_.add(input.readBool());
              break;
            }
            case 18: {
              int length = input.readRawVarint32();
              int limit = input.pushLimit(length);
              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) && input.getBytesUntilLimit() > 0) {
                buttons_ = new java.util.ArrayList<java.lang.Boolean>();
                mutable_bitField0_ |= 0x00000002;
              }
              while (input.getBytesUntilLimit() > 0) {
                buttons_.add(input.readBool());
              }
              input.popLimit(limit);
              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 {
        if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
          axes_ = java.util.Collections.unmodifiableList(axes_);
        }
        if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
          buttons_ = java.util.Collections.unmodifiableList(buttons_);
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return gazebo.msgs.GzJoystick.internal_static_gazebo_msgs_Joystick_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return gazebo.msgs.GzJoystick.internal_static_gazebo_msgs_Joystick_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              gazebo.msgs.GzJoystick.Joystick.class, gazebo.msgs.GzJoystick.Joystick.Builder.class);
    }

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

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

    // repeated double axes = 1;
    public static final int AXES_FIELD_NUMBER = 1;
    private java.util.List<java.lang.Double> axes_;
    /**
     * <code>repeated double axes = 1;</code>
     */
    public java.util.List<java.lang.Double>
        getAxesList() {
      return axes_;
    }
    /**
     * <code>repeated double axes = 1;</code>
     */
    public int getAxesCount() {
      return axes_.size();
    }
    /**
     * <code>repeated double axes = 1;</code>
     */
    public double getAxes(int index) {
      return axes_.get(index);
    }

    // repeated bool buttons = 2;
    public static final int BUTTONS_FIELD_NUMBER = 2;
    private java.util.List<java.lang.Boolean> buttons_;
    /**
     * <code>repeated bool buttons = 2;</code>
     */
    public java.util.List<java.lang.Boolean>
        getButtonsList() {
      return buttons_;
    }
    /**
     * <code>repeated bool buttons = 2;</code>
     */
    public int getButtonsCount() {
      return buttons_.size();
    }
    /**
     * <code>repeated bool buttons = 2;</code>
     */
    public boolean getButtons(int index) {
      return buttons_.get(index);
    }

    private void initFields() {
      axes_ = java.util.Collections.emptyList();
      buttons_ = java.util.Collections.emptyList();
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      for (int i = 0; i < axes_.size(); i++) {
        output.writeDouble(1, axes_.get(i));
      }
      for (int i = 0; i < buttons_.size(); i++) {
        output.writeBool(2, buttons_.get(i));
      }
      getUnknownFields().writeTo(output);
    }

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

      size = 0;
      {
        int dataSize = 0;
        dataSize = 8 * getAxesList().size();
        size += dataSize;
        size += 1 * getAxesList().size();
      }
      {
        int dataSize = 0;
        dataSize = 1 * getButtonsList().size();
        size += dataSize;
        size += 1 * getButtonsList().size();
      }
      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 gazebo.msgs.GzJoystick.Joystick parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static gazebo.msgs.GzJoystick.Joystick parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static gazebo.msgs.GzJoystick.Joystick parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static gazebo.msgs.GzJoystick.Joystick parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static gazebo.msgs.GzJoystick.Joystick parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static gazebo.msgs.GzJoystick.Joystick parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static gazebo.msgs.GzJoystick.Joystick parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static gazebo.msgs.GzJoystick.Joystick parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static gazebo.msgs.GzJoystick.Joystick parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static gazebo.msgs.GzJoystick.Joystick 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(gazebo.msgs.GzJoystick.Joystick 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 gazebo.msgs.Joystick}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements gazebo.msgs.GzJoystick.JoystickOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return gazebo.msgs.GzJoystick.internal_static_gazebo_msgs_Joystick_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return gazebo.msgs.GzJoystick.internal_static_gazebo_msgs_Joystick_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                gazebo.msgs.GzJoystick.Joystick.class, gazebo.msgs.GzJoystick.Joystick.Builder.class);
      }

      // Construct using gazebo.msgs.GzJoystick.Joystick.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();
        axes_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        buttons_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000002);
        return this;
      }

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

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return gazebo.msgs.GzJoystick.internal_static_gazebo_msgs_Joystick_descriptor;
      }

      public gazebo.msgs.GzJoystick.Joystick getDefaultInstanceForType() {
        return gazebo.msgs.GzJoystick.Joystick.getDefaultInstance();
      }

      public gazebo.msgs.GzJoystick.Joystick build() {
        gazebo.msgs.GzJoystick.Joystick result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public gazebo.msgs.GzJoystick.Joystick buildPartial() {
        gazebo.msgs.GzJoystick.Joystick result = new gazebo.msgs.GzJoystick.Joystick(this);
        int from_bitField0_ = bitField0_;
        if (((bitField0_ & 0x00000001) == 0x00000001)) {
          axes_ = java.util.Collections.unmodifiableList(axes_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.axes_ = axes_;
        if (((bitField0_ & 0x00000002) == 0x00000002)) {
          buttons_ = java.util.Collections.unmodifiableList(buttons_);
          bitField0_ = (bitField0_ & ~0x00000002);
        }
        result.buttons_ = buttons_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof gazebo.msgs.GzJoystick.Joystick) {
          return mergeFrom((gazebo.msgs.GzJoystick.Joystick)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(gazebo.msgs.GzJoystick.Joystick other) {
        if (other == gazebo.msgs.GzJoystick.Joystick.getDefaultInstance()) return this;
        if (!other.axes_.isEmpty()) {
          if (axes_.isEmpty()) {
            axes_ = other.axes_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureAxesIsMutable();
            axes_.addAll(other.axes_);
          }
          onChanged();
        }
        if (!other.buttons_.isEmpty()) {
          if (buttons_.isEmpty()) {
            buttons_ = other.buttons_;
            bitField0_ = (bitField0_ & ~0x00000002);
          } else {
            ensureButtonsIsMutable();
            buttons_.addAll(other.buttons_);
          }
          onChanged();
        }
        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 {
        gazebo.msgs.GzJoystick.Joystick parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (gazebo.msgs.GzJoystick.Joystick) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // repeated double axes = 1;
      private java.util.List<java.lang.Double> axes_ = java.util.Collections.emptyList();
      private void ensureAxesIsMutable() {
        if (!((bitField0_ & 0x00000001) == 0x00000001)) {
          axes_ = new java.util.ArrayList<java.lang.Double>(axes_);
          bitField0_ |= 0x00000001;
         }
      }
      /**
       * <code>repeated double axes = 1;</code>
       */
      public java.util.List<java.lang.Double>
          getAxesList() {
        return java.util.Collections.unmodifiableList(axes_);
      }
      /**
       * <code>repeated double axes = 1;</code>
       */
      public int getAxesCount() {
        return axes_.size();
      }
      /**
       * <code>repeated double axes = 1;</code>
       */
      public double getAxes(int index) {
        return axes_.get(index);
      }
      /**
       * <code>repeated double axes = 1;</code>
       */
      public Builder setAxes(
          int index, double value) {
        ensureAxesIsMutable();
        axes_.set(index, value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated double axes = 1;</code>
       */
      public Builder addAxes(double value) {
        ensureAxesIsMutable();
        axes_.add(value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated double axes = 1;</code>
       */
      public Builder addAllAxes(
          java.lang.Iterable<? extends java.lang.Double> values) {
        ensureAxesIsMutable();
        super.addAll(values, axes_);
        onChanged();
        return this;
      }
      /**
       * <code>repeated double axes = 1;</code>
       */
      public Builder clearAxes() {
        axes_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
        return this;
      }

      // repeated bool buttons = 2;
      private java.util.List<java.lang.Boolean> buttons_ = java.util.Collections.emptyList();
      private void ensureButtonsIsMutable() {
        if (!((bitField0_ & 0x00000002) == 0x00000002)) {
          buttons_ = new java.util.ArrayList<java.lang.Boolean>(buttons_);
          bitField0_ |= 0x00000002;
         }
      }
      /**
       * <code>repeated bool buttons = 2;</code>
       */
      public java.util.List<java.lang.Boolean>
          getButtonsList() {
        return java.util.Collections.unmodifiableList(buttons_);
      }
      /**
       * <code>repeated bool buttons = 2;</code>
       */
      public int getButtonsCount() {
        return buttons_.size();
      }
      /**
       * <code>repeated bool buttons = 2;</code>
       */
      public boolean getButtons(int index) {
        return buttons_.get(index);
      }
      /**
       * <code>repeated bool buttons = 2;</code>
       */
      public Builder setButtons(
          int index, boolean value) {
        ensureButtonsIsMutable();
        buttons_.set(index, value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated bool buttons = 2;</code>
       */
      public Builder addButtons(boolean value) {
        ensureButtonsIsMutable();
        buttons_.add(value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated bool buttons = 2;</code>
       */
      public Builder addAllButtons(
          java.lang.Iterable<? extends java.lang.Boolean> values) {
        ensureButtonsIsMutable();
        super.addAll(values, buttons_);
        onChanged();
        return this;
      }
      /**
       * <code>repeated bool buttons = 2;</code>
       */
      public Builder clearButtons() {
        buttons_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000002);
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:gazebo.msgs.Joystick)
    }

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

    // @@protoc_insertion_point(class_scope:gazebo.msgs.Joystick)
  }

  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_gazebo_msgs_Joystick_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_gazebo_msgs_Joystick_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n%frc_gazebo_plugin/msgs/joystick.proto\022" +
      "\013gazebo.msgs\")\n\010Joystick\022\014\n\004axes\030\001 \003(\001\022\017" +
      "\n\007buttons\030\002 \003(\010B\014B\nGzJoystick"
    };
    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
      new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
        public com.google.protobuf.ExtensionRegistry assignDescriptors(
            com.google.protobuf.Descriptors.FileDescriptor root) {
          descriptor = root;
          internal_static_gazebo_msgs_Joystick_descriptor =
            getDescriptor().getMessageTypes().get(0);
          internal_static_gazebo_msgs_Joystick_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_gazebo_msgs_Joystick_descriptor,
              new java.lang.String[] { "Axes", "Buttons", });
          return null;
        }
      };
    com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
        }, assigner);
  }

  // @@protoc_insertion_point(outer_class_scope)
}
