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

com.google.gerrit.server.git.MergeUtilFactory Maven / Gradle / Ivy

There is a newer version: 3.10.1
Show newest version
package com.google.gerrit.server.git;

import com.google.gerrit.extensions.registration.DynamicItem;
import com.google.gerrit.server.ChangeUtil;
import com.google.gerrit.server.IdentifiedUser;
import com.google.gerrit.server.approval.ApprovalsUtil;
import com.google.gerrit.server.config.GerritServerConfig;
import com.google.gerrit.server.config.UrlFormatter;
import com.google.gerrit.server.project.ProjectState;
import javax.annotation.processing.Generated;
import javax.inject.Inject;
import javax.inject.Provider;
import org.eclipse.jgit.lib.Config;

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

  private final Provider identifiedUserFactoryProvider;

  private final Provider> urlFormatterProvider;

  private final Provider approvalsUtilProvider;

  private final Provider commitMessageGeneratorProvider;

  private final Provider changeUtilProvider;

  @Inject
  public MergeUtilFactory(@GerritServerConfig Provider serverConfigProvider,
      Provider identifiedUserFactoryProvider,
      Provider> urlFormatterProvider,
      Provider approvalsUtilProvider,
      Provider commitMessageGeneratorProvider,
      Provider changeUtilProvider) {
    this.serverConfigProvider = checkNotNull(serverConfigProvider, 1);
    this.identifiedUserFactoryProvider = checkNotNull(identifiedUserFactoryProvider, 2);
    this.urlFormatterProvider = checkNotNull(urlFormatterProvider, 3);
    this.approvalsUtilProvider = checkNotNull(approvalsUtilProvider, 4);
    this.commitMessageGeneratorProvider = checkNotNull(commitMessageGeneratorProvider, 5);
    this.changeUtilProvider = checkNotNull(changeUtilProvider, 6);
  }

  public MergeUtil create(ProjectState project) {
    return new MergeUtil(checkNotNull(serverConfigProvider.get(), 1), checkNotNull(identifiedUserFactoryProvider.get(), 2), checkNotNull(urlFormatterProvider.get(), 3), checkNotNull(approvalsUtilProvider.get(), 4), checkNotNull(commitMessageGeneratorProvider.get(), 5), checkNotNull(changeUtilProvider.get(), 6), checkNotNull(project, 7));
  }

  public MergeUtil create(ProjectState project, boolean useContentMerge) {
    return new MergeUtil(checkNotNull(serverConfigProvider.get(), 1), checkNotNull(identifiedUserFactoryProvider.get(), 2), checkNotNull(urlFormatterProvider.get(), 3), checkNotNull(approvalsUtilProvider.get(), 4), checkNotNull(commitMessageGeneratorProvider.get(), 5), checkNotNull(changeUtilProvider.get(), 6), checkNotNull(project, 7), useContentMerge);
  }

  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