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

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

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

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 OutgoingEmailFactory {
  private final Provider argsProvider;

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

  public OutgoingEmail create(String messageClass, OutgoingEmail.EmailDecorator templateProvider) {
    return new OutgoingEmail(checkNotNull(argsProvider.get(), 1), checkNotNull(messageClass, 2), checkNotNull(templateProvider, 3));
  }

  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