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

com.google.gerrit.server.$AutoValue_RequestInfo Maven / Gradle / Ivy

There is a newer version: 3.10.0-rc7
Show newest version
package com.google.gerrit.server;

import com.google.gerrit.entities.Project;
import com.google.gerrit.server.logging.TraceContext;
import java.util.Optional;
import javax.annotation.processing.Generated;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
abstract class $AutoValue_RequestInfo extends RequestInfo {

  private final String requestType;

  private final Optional requestUri;

  private final CurrentUser callingUser;

  private final TraceContext traceContext;

  private final Optional project;

  $AutoValue_RequestInfo(
      String requestType,
      Optional requestUri,
      CurrentUser callingUser,
      TraceContext traceContext,
      Optional project) {
    if (requestType == null) {
      throw new NullPointerException("Null requestType");
    }
    this.requestType = requestType;
    if (requestUri == null) {
      throw new NullPointerException("Null requestUri");
    }
    this.requestUri = requestUri;
    if (callingUser == null) {
      throw new NullPointerException("Null callingUser");
    }
    this.callingUser = callingUser;
    if (traceContext == null) {
      throw new NullPointerException("Null traceContext");
    }
    this.traceContext = traceContext;
    if (project == null) {
      throw new NullPointerException("Null project");
    }
    this.project = project;
  }

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

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

  @Override
  public CurrentUser callingUser() {
    return callingUser;
  }

  @Override
  public TraceContext traceContext() {
    return traceContext;
  }

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

  @Override
  public String toString() {
    return "RequestInfo{"
        + "requestType=" + requestType + ", "
        + "requestUri=" + requestUri + ", "
        + "callingUser=" + callingUser + ", "
        + "traceContext=" + traceContext + ", "
        + "project=" + project
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof RequestInfo) {
      RequestInfo that = (RequestInfo) o;
      return this.requestType.equals(that.requestType())
          && this.requestUri.equals(that.requestUri())
          && this.callingUser.equals(that.callingUser())
          && this.traceContext.equals(that.traceContext())
          && this.project.equals(that.project());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= requestType.hashCode();
    h$ *= 1000003;
    h$ ^= requestUri.hashCode();
    h$ *= 1000003;
    h$ ^= callingUser.hashCode();
    h$ *= 1000003;
    h$ ^= traceContext.hashCode();
    h$ *= 1000003;
    h$ ^= project.hashCode();
    return h$;
  }

  static class Builder extends RequestInfo.Builder {
    private String requestType;
    private Optional requestUri = Optional.empty();
    private CurrentUser callingUser;
    private TraceContext traceContext;
    private Optional project = Optional.empty();
    Builder() {
    }
    @Override
    public RequestInfo.Builder requestType(String requestType) {
      if (requestType == null) {
        throw new NullPointerException("Null requestType");
      }
      this.requestType = requestType;
      return this;
    }
    @Override
    public RequestInfo.Builder requestUri(String requestUri) {
      this.requestUri = Optional.of(requestUri);
      return this;
    }
    @Override
    public RequestInfo.Builder callingUser(CurrentUser callingUser) {
      if (callingUser == null) {
        throw new NullPointerException("Null callingUser");
      }
      this.callingUser = callingUser;
      return this;
    }
    @Override
    public RequestInfo.Builder traceContext(TraceContext traceContext) {
      if (traceContext == null) {
        throw new NullPointerException("Null traceContext");
      }
      this.traceContext = traceContext;
      return this;
    }
    @Override
    public RequestInfo.Builder project(Project.NameKey project) {
      this.project = Optional.of(project);
      return this;
    }
    @Override
    public RequestInfo build() {
      String missing = "";
      if (this.requestType == null) {
        missing += " requestType";
      }
      if (this.callingUser == null) {
        missing += " callingUser";
      }
      if (this.traceContext == null) {
        missing += " traceContext";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_RequestInfo(
          this.requestType,
          this.requestUri,
          this.callingUser,
          this.traceContext,
          this.project);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy