// 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 static com.squareup.wire.Message.Datatype.INT32;

public final class DataBundleTypedValue extends Message {

  public static final Integer DEFAULT_TYPE = 0;

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

  @ProtoField(tag = 2)
  public final DataBundleValue value;

  public DataBundleTypedValue(Integer type, DataBundleValue value) {
    this.type = type;
    this.value = value;
  }

  private DataBundleTypedValue(Builder builder) {
    this(builder.type, builder.value);
    setBuilder(builder);
  }

  @Override
  public boolean equals(Object other) {
    if (other == this) return true;
    if (!(other instanceof DataBundleTypedValue)) return false;
    DataBundleTypedValue o = (DataBundleTypedValue) other;
    return equals(type, o.type)
        && equals(value, o.value);
  }

  @Override
  public int hashCode() {
    int result = hashCode;
    if (result == 0) {
      result = type != null ? type.hashCode() : 0;
      result = result * 37 + (value != null ? value.hashCode() : 0);
      hashCode = result;
    }
    return result;
  }

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

    public Integer type;
    public DataBundleValue value;

    public Builder() {
    }

    public Builder(DataBundleTypedValue message) {
      super(message);
      if (message == null) return;
      this.type = message.type;
      this.value = message.value;
    }

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

    public Builder value(DataBundleValue value) {
      this.value = value;
      return this;
    }

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