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

com.google.gerrit.common.data.AutoValue_SubmitRequirement Maven / Gradle / Ivy

There is a newer version: 3.10.0-rc4
Show newest version


package com.google.gerrit.common.data;

import com.google.common.annotations.GwtIncompatible;
import com.google.common.collect.ImmutableMap;
import javax.annotation.Generated;

@GwtIncompatible
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_SubmitRequirement extends SubmitRequirement {

  private final String fallbackText;

  private final String type;

  private final ImmutableMap data;

  private AutoValue_SubmitRequirement(
      String fallbackText,
      String type,
      ImmutableMap data) {
    this.fallbackText = fallbackText;
    this.type = type;
    this.data = data;
  }

  @Override
  public String fallbackText() {
    return fallbackText;
  }

  @Override
  public String type() {
    return type;
  }

  @Override
  public ImmutableMap data() {
    return data;
  }

  @Override
  public String toString() {
    return "SubmitRequirement{"
         + "fallbackText=" + fallbackText + ", "
         + "type=" + type + ", "
         + "data=" + data
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof SubmitRequirement) {
      SubmitRequirement that = (SubmitRequirement) o;
      return (this.fallbackText.equals(that.fallbackText()))
           && (this.type.equals(that.type()))
           && (this.data.equals(that.data()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= fallbackText.hashCode();
    h$ *= 1000003;
    h$ ^= type.hashCode();
    h$ *= 1000003;
    h$ ^= data.hashCode();
    return h$;
  }

  static final class Builder extends SubmitRequirement.Builder {
    private String fallbackText;
    private String type;
    private ImmutableMap.Builder dataBuilder$;
    private ImmutableMap data;
    Builder() {
    }
    @Override
    public SubmitRequirement.Builder setFallbackText(String fallbackText) {
      if (fallbackText == null) {
        throw new NullPointerException("Null fallbackText");
      }
      this.fallbackText = fallbackText;
      return this;
    }
    @Override
    public SubmitRequirement.Builder setType(String type) {
      if (type == null) {
        throw new NullPointerException("Null type");
      }
      this.type = type;
      return this;
    }
    @Override
    SubmitRequirement.Builder setData(ImmutableMap data) {
      if (data == null) {
        throw new NullPointerException("Null data");
      }
      if (dataBuilder$ != null) {
        throw new IllegalStateException("Cannot set data after calling dataBuilder()");
      }
      this.data = data;
      return this;
    }
    @Override
    ImmutableMap.Builder dataBuilder() {
      if (dataBuilder$ == null) {
        if (data == null) {
          dataBuilder$ = ImmutableMap.builder();
        } else {
          dataBuilder$ = ImmutableMap.builder();
          dataBuilder$.putAll(data);
          data = null;
        }
      }
      return dataBuilder$;
    }
    @Override
    SubmitRequirement autoBuild() {
      if (dataBuilder$ != null) {
        this.data = dataBuilder$.build();
      } else if (this.data == null) {
        this.data = ImmutableMap.of();
      }
      String missing = "";
      if (this.fallbackText == null) {
        missing += " fallbackText";
      }
      if (this.type == null) {
        missing += " type";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_SubmitRequirement(
          this.fallbackText,
          this.type,
          this.data);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy