com.google.gerrit.server.restapi.change.PostReviewCopyApprovalsOpFactory Maven / Gradle / Ivy
package com.google.gerrit.server.restapi.change;
import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.server.PatchSetUtil;
import com.google.gerrit.server.approval.ApprovalCopier;
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 PostReviewCopyApprovalsOpFactory {
private final Provider approvalCopierProvider;
private final Provider patchSetUtilProvider;
@Inject
public PostReviewCopyApprovalsOpFactory(Provider approvalCopierProvider,
Provider patchSetUtilProvider) {
this.approvalCopierProvider = checkNotNull(approvalCopierProvider, 1);
this.patchSetUtilProvider = checkNotNull(patchSetUtilProvider, 2);
}
public PostReviewCopyApprovalsOp create(PatchSet.Id patchSetId) {
return new PostReviewCopyApprovalsOp(checkNotNull(approvalCopierProvider.get(), 1), checkNotNull(patchSetUtilProvider.get(), 2), checkNotNull(patchSetId, 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