com.google.gerrit.server.submitrequirement.predicate.RegexUploaderEmailPredicateFactory Maven / Gradle / Ivy
package com.google.gerrit.server.submitrequirement.predicate;
import com.google.gerrit.index.query.QueryParseException;
import com.google.gerrit.server.account.AccountCache;
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 RegexUploaderEmailPredicateFactory {
private final Provider accountCacheProvider;
@Inject
public RegexUploaderEmailPredicateFactory(Provider accountCacheProvider) {
this.accountCacheProvider = checkNotNull(accountCacheProvider, 1);
}
public RegexUploaderEmailPredicate create(String pattern) throws QueryParseException {
return new RegexUploaderEmailPredicate(checkNotNull(accountCacheProvider.get(), 1), checkNotNull(pattern, 2));
}
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