congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Branch.withId
Code IndexAdd Tabnine to your IDE (free)

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

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

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-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-repository-impl

@Override
public Branch newBranch(Branch branch) {
  // Creation
  try {
    int id = dbCreate(
        "INSERT INTO BRANCHES(PROJECTID, NAME, DESCRIPTION, DISABLED, CREATION, CREATOR) VALUES (:projectId, :name, :description, :disabled, :creation, :creator)",
        params("name", branch.getName())
            .addValue("description", branch.getDescription())
            .addValue("disabled", branch.isDisabled())
            .addValue("projectId", branch.getProject().id())
            .addValue("creation", dateTimeForDB(branch.getSignature().getTime()))
            .addValue("creator", branch.getSignature().getUser().getName())
    );
    // Returns with ID
    return branch.withId(id(id));
  } catch (DuplicateKeyException ex) {
    throw new BranchNameAlreadyDefinedException(branch.getName());
  }
}
net.nemerosa.ontrack.model.structureBranchwithId

Popular methods of Branch

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

Popular in Java

  • Reactive rest calls using spring rest template
  • getSupportFragmentManager (FragmentActivity)
  • findViewById (Activity)
  • getContentResolver (Context)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JCheckBox (javax.swing)
  • 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