Tabnine Logo
Branch.of
Code IndexAdd Tabnine to your IDE (free)

How to use
of
method
in
net.nemerosa.ontrack.model.structure.Branch

Best Java code snippets using net.nemerosa.ontrack.model.structure.Branch.of (Showing top 7 results out of 315)

origin: net.nemerosa.ontrack/ontrack-model

public static Branch of(Project project, NameDescription nameDescription) {
  return of(project, nameDescription.asState());
}
origin: net.nemerosa.ontrack/ontrack-model

  public Branch update(NameDescriptionState form) {
    return of(project, form).withId(id).withDisabled(form.isDisabled());
  }
}
origin: net.nemerosa.ontrack/ontrack-service

protected Branch createBranchForTemplateInstance(Branch templateBranch, String branchName) {
  return structureService.newBranch(
      Branch.of(
          templateBranch.getProject(),
          NameDescription.nd(
              NameDescription.escapeName(branchName),
              ""
          )
      )
  );
}
origin: net.nemerosa.ontrack/ontrack-repository-impl

protected Branch toBranch(ResultSet rs, Function<ID, Project> projectSupplier) throws SQLException {
  ID projectId = id(rs, "projectId");
  ID branchId = id(rs);
  return Branch.of(
      projectSupplier.apply(projectId),
      new NameDescription(
          rs.getString("name"),
          rs.getString("description")
      )
  )
      .withId(branchId)
      .withSignature(readSignature(rs))
      .withType(getBranchType(branchId))
      .withDisabled(rs.getBoolean("disabled"));
}
origin: net.nemerosa.ontrack/ontrack-it-utils

protected Branch doCreateBranch(Project project, NameDescription nameDescription) throws Exception {
  return asUser().with(project.id(), BranchCreate.class).call(() -> structureService.newBranch(
      Branch.of(project, nameDescription)
  ));
}
origin: net.nemerosa.ontrack/ontrack-service

@Override
public Branch cloneBranch(Branch sourceBranch, BranchCloneRequest request) {
  // Replacement function
  Function<String, String> replacementFn = replacementFn(request.getReplacements());
  // Description of the target branch
  String targetDescription = replacementFn.apply(sourceBranch.getDescription());
  // Creates the branch
  Branch targetBranch = structureService.newBranch(
      Branch.of(
          sourceBranch.getProject(),
          NameDescription.nd(request.getName(), targetDescription)
      )
  );
  // Copies the configuration
  doCopy(sourceBranch, targetBranch, replacementFn, SyncPolicy.COPY);
  // OK
  return targetBranch;
}
origin: net.nemerosa.ontrack/ontrack-service

@Override
public Project cloneProject(Project sourceProject, ProjectCloneRequest request) {
  // Replacement function
  Function<String, String> replacementFn = replacementFn(request.getReplacements());
  // Description of the target project
  String targetProjectDescription = replacementFn.apply(sourceProject.getDescription());
  // Creates the project
  Project targetProject = structureService.newProject(
      Project.of(
          NameDescription.nd(request.getName(), targetProjectDescription)
      )
  );
  // Copies the properties for the project
  doCopyProperties(sourceProject, targetProject, replacementFn, SyncPolicy.COPY);
  // Creates a copy of the branch
  Branch sourceBranch = structureService.getBranch(request.getSourceBranchId());
  String targetBranchName = replacementFn.apply(sourceBranch.getName());
  String targetBranchDescription = replacementFn.apply(sourceBranch.getDescription());
  Branch targetBranch = structureService.newBranch(
      Branch.of(
          targetProject,
          NameDescription.nd(targetBranchName, targetBranchDescription)
      )
  );
  // Configuration of the new branch
  doCopy(sourceBranch, targetBranch, replacementFn, SyncPolicy.COPY);
  // OK
  return targetProject;
}
net.nemerosa.ontrack.model.structureBranchof

Popular methods of Branch

  • getProject
  • getName
  • getId
  • getType
  • id
  • isDisabled
  • projectId
  • withDisabled
  • getDescription
  • getSignature
  • withId
  • <init>
  • withId,
  • <init>,
  • form,
  • withDescription,
  • withSignature,
  • withType

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • compareTo (BigDecimal)
  • getExternalFilesDir (Context)
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Notification (javax.management)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now