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

dagger.model.$AutoValue_Key Maven / Gradle / Ivy

There is a newer version: 2.52
Show newest version
package dagger.model;

import com.google.common.base.Equivalence;
import java.util.Optional;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.type.TypeMirror;

// Generated by com.google.auto.value.processor.AutoValueProcessor
abstract class $AutoValue_Key extends Key {

  private final Optional> wrappedQualifier;

  private final Equivalence.Wrapper wrappedType;

  private final Optional multibindingContributionIdentifier;

  $AutoValue_Key(
      Optional> wrappedQualifier,
      Equivalence.Wrapper wrappedType,
      Optional multibindingContributionIdentifier) {
    if (wrappedQualifier == null) {
      throw new NullPointerException("Null wrappedQualifier");
    }
    this.wrappedQualifier = wrappedQualifier;
    if (wrappedType == null) {
      throw new NullPointerException("Null wrappedType");
    }
    this.wrappedType = wrappedType;
    if (multibindingContributionIdentifier == null) {
      throw new NullPointerException("Null multibindingContributionIdentifier");
    }
    this.multibindingContributionIdentifier = multibindingContributionIdentifier;
  }

  @Override
  Optional> wrappedQualifier() {
    return wrappedQualifier;
  }

  @Override
  Equivalence.Wrapper wrappedType() {
    return wrappedType;
  }

  @Override
  public Optional multibindingContributionIdentifier() {
    return multibindingContributionIdentifier;
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof Key) {
      Key that = (Key) o;
      return this.wrappedQualifier.equals(that.wrappedQualifier())
          && this.wrappedType.equals(that.wrappedType())
          && this.multibindingContributionIdentifier.equals(that.multibindingContributionIdentifier());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= wrappedQualifier.hashCode();
    h$ *= 1000003;
    h$ ^= wrappedType.hashCode();
    h$ *= 1000003;
    h$ ^= multibindingContributionIdentifier.hashCode();
    return h$;
  }

  @Override
  public Key.Builder toBuilder() {
    return new Builder(this);
  }

  static class Builder extends Key.Builder {
    private Optional> wrappedQualifier = Optional.empty();
    private Equivalence.Wrapper wrappedType;
    private Optional multibindingContributionIdentifier = Optional.empty();
    Builder() {
    }
    private Builder(Key source) {
      this.wrappedQualifier = source.wrappedQualifier();
      this.wrappedType = source.wrappedType();
      this.multibindingContributionIdentifier = source.multibindingContributionIdentifier();
    }
    @Override
    Key.Builder wrappedQualifier(Optional> wrappedQualifier) {
      if (wrappedQualifier == null) {
        throw new NullPointerException("Null wrappedQualifier");
      }
      this.wrappedQualifier = wrappedQualifier;
      return this;
    }
    @Override
    Key.Builder wrappedQualifier(Equivalence.Wrapper wrappedQualifier) {
      this.wrappedQualifier = Optional.of(wrappedQualifier);
      return this;
    }
    @Override
    Key.Builder wrappedType(Equivalence.Wrapper wrappedType) {
      if (wrappedType == null) {
        throw new NullPointerException("Null wrappedType");
      }
      this.wrappedType = wrappedType;
      return this;
    }
    @Override
    public Key.Builder multibindingContributionIdentifier(Optional multibindingContributionIdentifier) {
      if (multibindingContributionIdentifier == null) {
        throw new NullPointerException("Null multibindingContributionIdentifier");
      }
      this.multibindingContributionIdentifier = multibindingContributionIdentifier;
      return this;
    }
    @Override
    public Key.Builder multibindingContributionIdentifier(Key.MultibindingContributionIdentifier multibindingContributionIdentifier) {
      this.multibindingContributionIdentifier = Optional.of(multibindingContributionIdentifier);
      return this;
    }
    @Override
    public Key build() {
      if (this.wrappedType == null) {
        String missing = " wrappedType";
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_Key(
          this.wrappedQualifier,
          this.wrappedType,
          this.multibindingContributionIdentifier);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy