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

com.google.gerrit.server.mail.send.ChangeEmailImplFactory Maven / Gradle / Ivy

There is a newer version: 3.11.0-rc3
Show newest version
package com.google.gerrit.server.mail.send;

import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.Project;
import javax.annotation.processing.Generated;
import javax.inject.Inject;
import javax.inject.Provider;

@Generated(
    value = "com.google.auto.factory.processor.AutoFactoryProcessor",
    comments = "https://github.com/google/auto/tree/master/factory"
)
public final class ChangeEmailImplFactory {
  private final Provider argsProvider;

  @Inject
  public ChangeEmailImplFactory(Provider argsProvider) {
    this.argsProvider = checkNotNull(argsProvider, 1);
  }

  public ChangeEmailImpl create(Project.NameKey project, Change.Id changeId,
      ChangeEmail.ChangeEmailDecorator changeEmailDecorator) {
    return new ChangeEmailImpl(checkNotNull(argsProvider.get(), 1), checkNotNull(project, 2), checkNotNull(changeId, 3), checkNotNull(changeEmailDecorator, 4));
  }

  private static  T checkNotNull(T reference, int argumentIndex) {
    if (reference == null) {
      throw new NullPointerException("@AutoFactory method argument is null but is not marked @Nullable. Argument index: " + argumentIndex);
    }
    return reference;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy