View Javadoc
1   package de.tud.plt.r43ples.existentobjects;
2   
3   import de.tud.plt.r43ples.exception.InternalErrorException;
4   import org.apache.logging.log4j.LogManager;
5   import org.apache.logging.log4j.Logger;
6   
7   /**
8    * Provides information of an already existent branch.
9    *
10   * @author Stephan Hensel
11   */
12  public class Branch extends Reference {
13  
14      /** The logger. **/
15      private Logger logger = LogManager.getLogger(Branch.class);
16  
17  
18      /**
19       * The constructor.
20       *
21       * @param revisionGraph the revision graph
22       * @param branchInformation the branch information (identifier or URI of the branch)
23       * @param isIdentifier identifies if the identifier or the URI of the branch is specified (identifier => true; URI => false)
24       * @throws InternalErrorException
25       */
26      public Branch(RevisionGraph revisionGraph, String branchInformation, boolean isIdentifier) throws InternalErrorException {
27          super(revisionGraph, branchInformation, isIdentifier);
28      }
29  
30      /**
31       * The constructor.
32       *
33       * @param revisionGraph the revision graph
34       * @param referenceIdentifier the reference identifier
35       * @param referenceURI the reference URI
36       * @param fullGraphURI the full graph URI
37       * @throws InternalErrorException
38       */
39      public Branch(RevisionGraph revisionGraph, String referenceIdentifier, String referenceURI, String fullGraphURI) throws InternalErrorException {
40          super(revisionGraph, referenceIdentifier, referenceURI, fullGraphURI);
41      }
42  
43      /**
44       * Get the leaf revision of current branch.
45       *
46       * @return the leaf revision
47       * @throws InternalErrorException
48       */
49      public Revision getLeafRevision() throws InternalErrorException {
50          return this.getRevisionGraph().getRevision(this.getReferenceIdentifier());
51      }
52  
53  }