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

public final class DataBundle extends Message {

  public static final List<DataBundleEntry> DEFAULT_ENTRIES = Collections.emptyList();

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

  public DataBundle(List<DataBundleEntry> entries) {
    this.entries = immutableCopyOf(entries);
  }

  private DataBundle(Builder builder) {
    this(builder.entries);
    setBuilder(builder);
  }

  @Override
  public boolean equals(Object other) {
    if (other == this) return true;
    if (!(other instanceof DataBundle)) return false;
    return equals(entries, ((DataBundle) other).entries);
  }

  @Override
  public int hashCode() {
    int result = hashCode;
    return result != 0 ? result : (hashCode = entries != null ? entries.hashCode() : 1);
  }

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

    public List<DataBundleEntry> entries;

    public Builder() {
    }

    public Builder(DataBundle message) {
      super(message);
      if (message == null) return;
      this.entries = copyOf(message.entries);
    }

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

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