// Code generated by Wire protocol buffer compiler, do not edit.
// Source file: protos-repo/databundle.proto
package org.microg.gms.wearable.databundle;

import com.squareup.wire.Message;
import com.squareup.wire.ProtoField;
import java.util.Collections;
import java.util.List;
import okio.ByteString;

import static com.squareup.wire.Message.Datatype.BOOL;
import static com.squareup.wire.Message.Datatype.BYTES;
import static com.squareup.wire.Message.Datatype.DOUBLE;
import static com.squareup.wire.Message.Datatype.FLOAT;
import static com.squareup.wire.Message.Datatype.INT32;
import static com.squareup.wire.Message.Datatype.INT64;
import static com.squareup.wire.Message.Datatype.STRING;
import static com.squareup.wire.Message.Label.REPEATED;

public final class DataBundleValue extends Message {

  public static final ByteString DEFAULT_BYTEARRAY = ByteString.EMPTY;
  public static final String DEFAULT_STRINGVAL = "";
  public static final Double DEFAULT_DOUBLEVAL = 0D;
  public static final Float DEFAULT_FLOATVAL = 0F;
  public static final Long DEFAULT_LONGVAL = 0L;
  public static final Integer DEFAULT_INTVAL = 0;
  public static final Integer DEFAULT_BYTEVAL = 0;
  public static final Boolean DEFAULT_BOOLEANVAL = false;
  public static final List<DataBundleEntry> DEFAULT_MAP = Collections.emptyList();
  public static final List<DataBundleTypedValue> DEFAULT_LIST = Collections.emptyList();
  public static final List<String> DEFAULT_STRINGARRAY = Collections.emptyList();
  public static final List<Long> DEFAULT_LONGARRAY = Collections.emptyList();
  public static final Integer DEFAULT_LENGTH = 0;
  public static final List<Float> DEFAULT_FLOATARRAY = Collections.emptyList();

  @ProtoField(tag = 1, type = BYTES)
  public final ByteString byteArray;

  @ProtoField(tag = 2, type = STRING)
  public final String stringVal;

  @ProtoField(tag = 3, type = DOUBLE)
  public final Double doubleVal;

  @ProtoField(tag = 4, type = FLOAT)
  public final Float floatVal;

  @ProtoField(tag = 5, type = INT64)
  public final Long longVal;

  @ProtoField(tag = 6, type = INT32)
  public final Integer intVal;

  @ProtoField(tag = 7, type = INT32)
  public final Integer byteVal;

  @ProtoField(tag = 8, type = BOOL)
  public final Boolean booleanVal;

  @ProtoField(tag = 9, label = REPEATED, messageType = DataBundleEntry.class)
  public final List<DataBundleEntry> map;

  @ProtoField(tag = 10, label = REPEATED, messageType = DataBundleTypedValue.class)
  public final List<DataBundleTypedValue> list;

  @ProtoField(tag = 11, type = STRING, label = REPEATED)
  public final List<String> stringArray;

  @ProtoField(tag = 12, type = INT64, label = REPEATED)
  public final List<Long> longArray;

  @ProtoField(tag = 13, type = INT32)
  public final Integer length;

  @ProtoField(tag = 14, type = FLOAT, label = REPEATED)
  public final List<Float> floatArray;

  public DataBundleValue(ByteString byteArray, String stringVal, Double doubleVal, Float floatVal, Long longVal, Integer intVal, Integer byteVal, Boolean booleanVal, List<DataBundleEntry> map, List<DataBundleTypedValue> list, List<String> stringArray, List<Long> longArray, Integer length, List<Float> floatArray) {
    this.byteArray = byteArray;
    this.stringVal = stringVal;
    this.doubleVal = doubleVal;
    this.floatVal = floatVal;
    this.longVal = longVal;
    this.intVal = intVal;
    this.byteVal = byteVal;
    this.booleanVal = booleanVal;
    this.map = immutableCopyOf(map);
    this.list = immutableCopyOf(list);
    this.stringArray = immutableCopyOf(stringArray);
    this.longArray = immutableCopyOf(longArray);
    this.length = length;
    this.floatArray = immutableCopyOf(floatArray);
  }

  private DataBundleValue(Builder builder) {
    this(builder.byteArray, builder.stringVal, builder.doubleVal, builder.floatVal, builder.longVal, builder.intVal, builder.byteVal, builder.booleanVal, builder.map, builder.list, builder.stringArray, builder.longArray, builder.length, builder.floatArray);
    setBuilder(builder);
  }

  @Override
  public boolean equals(Object other) {
    if (other == this) return true;
    if (!(other instanceof DataBundleValue)) return false;
    DataBundleValue o = (DataBundleValue) other;
    return equals(byteArray, o.byteArray)
        && equals(stringVal, o.stringVal)
        && equals(doubleVal, o.doubleVal)
        && equals(floatVal, o.floatVal)
        && equals(longVal, o.longVal)
        && equals(intVal, o.intVal)
        && equals(byteVal, o.byteVal)
        && equals(booleanVal, o.booleanVal)
        && equals(map, o.map)
        && equals(list, o.list)
        && equals(stringArray, o.stringArray)
        && equals(longArray, o.longArray)
        && equals(length, o.length)
        && equals(floatArray, o.floatArray);
  }

  @Override
  public int hashCode() {
    int result = hashCode;
    if (result == 0) {
      result = byteArray != null ? byteArray.hashCode() : 0;
      result = result * 37 + (stringVal != null ? stringVal.hashCode() : 0);
      result = result * 37 + (doubleVal != null ? doubleVal.hashCode() : 0);
      result = result * 37 + (floatVal != null ? floatVal.hashCode() : 0);
      result = result * 37 + (longVal != null ? longVal.hashCode() : 0);
      result = result * 37 + (intVal != null ? intVal.hashCode() : 0);
      result = result * 37 + (byteVal != null ? byteVal.hashCode() : 0);
      result = result * 37 + (booleanVal != null ? booleanVal.hashCode() : 0);
      result = result * 37 + (map != null ? map.hashCode() : 1);
      result = result * 37 + (list != null ? list.hashCode() : 1);
      result = result * 37 + (stringArray != null ? stringArray.hashCode() : 1);
      result = result * 37 + (longArray != null ? longArray.hashCode() : 1);
      result = result * 37 + (length != null ? length.hashCode() : 0);
      result = result * 37 + (floatArray != null ? floatArray.hashCode() : 1);
      hashCode = result;
    }
    return result;
  }

  public static final class Builder extends Message.Builder<DataBundleValue> {

    public ByteString byteArray;
    public String stringVal;
    public Double doubleVal;
    public Float floatVal;
    public Long longVal;
    public Integer intVal;
    public Integer byteVal;
    public Boolean booleanVal;
    public List<DataBundleEntry> map;
    public List<DataBundleTypedValue> list;
    public List<String> stringArray;
    public List<Long> longArray;
    public Integer length;
    public List<Float> floatArray;

    public Builder() {
    }

    public Builder(DataBundleValue message) {
      super(message);
      if (message == null) return;
      this.byteArray = message.byteArray;
      this.stringVal = message.stringVal;
      this.doubleVal = message.doubleVal;
      this.floatVal = message.floatVal;
      this.longVal = message.longVal;
      this.intVal = message.intVal;
      this.byteVal = message.byteVal;
      this.booleanVal = message.booleanVal;
      this.map = copyOf(message.map);
      this.list = copyOf(message.list);
      this.stringArray = copyOf(message.stringArray);
      this.longArray = copyOf(message.longArray);
      this.length = message.length;
      this.floatArray = copyOf(message.floatArray);
    }

    public Builder byteArray(ByteString byteArray) {
      this.byteArray = byteArray;
      return this;
    }

    public Builder stringVal(String stringVal) {
      this.stringVal = stringVal;
      return this;
    }

    public Builder doubleVal(Double doubleVal) {
      this.doubleVal = doubleVal;
      return this;
    }

    public Builder floatVal(Float floatVal) {
      this.floatVal = floatVal;
      return this;
    }

    public Builder longVal(Long longVal) {
      this.longVal = longVal;
      return this;
    }

    public Builder intVal(Integer intVal) {
      this.intVal = intVal;
      return this;
    }

    public Builder byteVal(Integer byteVal) {
      this.byteVal = byteVal;
      return this;
    }

    public Builder booleanVal(Boolean booleanVal) {
      this.booleanVal = booleanVal;
      return this;
    }

    public Builder map(List<DataBundleEntry> map) {
      this.map = checkForNulls(map);
      return this;
    }

    public Builder list(List<DataBundleTypedValue> list) {
      this.list = checkForNulls(list);
      return this;
    }

    public Builder stringArray(List<String> stringArray) {
      this.stringArray = checkForNulls(stringArray);
      return this;
    }

    public Builder longArray(List<Long> longArray) {
      this.longArray = checkForNulls(longArray);
      return this;
    }

    public Builder length(Integer length) {
      this.length = length;
      return this;
    }

    public Builder floatArray(List<Float> floatArray) {
      this.floatArray = checkForNulls(floatArray);
      return this;
    }

    @Override
    public DataBundleValue build() {
      return new DataBundleValue(this);
    }
  }
}
