View Javadoc

1   /*
2   The MIT License
3   
4   Copyright (c) 2004, The Codehaus
5   
6   Permission is hereby granted, free of charge, to any person obtaining a copy of
7   this software and associated documentation files (the "Software"), to deal in
8   the Software without restriction, including without limitation the rights to
9   use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10  of the Software, and to permit persons to whom the Software is furnished to do
11  so, subject to the following conditions:
12  
13  The above copyright notice and this permission notice shall be included in all
14  copies or substantial portions of the Software.
15  
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  SOFTWARE.
23   */
24  package org.codehaus.mojo.scmchangelog.scm.hg.command.changelog;
25  
26  import java.util.Date;
27  import java.util.List;
28  
29  import org.apache.maven.scm.ChangeSet;
30  
31  /**
32   * ChangeSet with the revision.
33   * @author ehsavoie
34   * @version $Id: BetterChangeSet.java 7652 2008-09-11 07:58:40Z ehsavoie $
35   *
36   * @see org.apache.maven.scm.ChangeSet
37   */
38  public class BetterChangeSet
39      extends ChangeSet
40  {
41  
42    /**
43     * The SCM revision id for this changeset.
44     */
45    private String revision;
46  
47    /**
48     * Constructor of a ChangeSet.
49     * @param strDate         Date the changes were committed.
50     * @param userDatePattern pattern of date.
51     * @param comment         comment provided at commit time.
52     * @param author          User who made changes.
53     * @param files           The ChangeFile list.
54     * @param currentRevision The revision.
55     */
56    public BetterChangeSet( String strDate, String userDatePattern,
57        String comment, String author, List /*<ChangeFile>*/ files,
58        String currentRevision )
59    {
60      super( strDate, userDatePattern, comment, author, files );
61      this.revision = currentRevision;
62    }
63  
64    /**
65     * Constructor of a ChangeSet.
66     * @param date    Date the changes were committed
67     * @param comment comment provided at commit time
68     * @param author  User who made changes
69     * @param files   The ChangeFile list
70     * @param currentRevision The revision.
71     */
72    public BetterChangeSet( Date date, String comment, String author,
73        List /*<ChangeFile>*/ files, String currentRevision )
74    {
75      super( date, comment, author, files );
76      this.revision = currentRevision;
77    }
78  
79    /**
80     * Constructor used when attributes aren't available until later
81     */
82    public BetterChangeSet()
83    {
84      super();
85    }
86  
87    /**
88     * Getter for the SCM revision id of this changeset.
89     * @return the SCM revision id of this changeset.
90     */
91    public String getRevision()
92    {
93      return this.revision;
94    }
95  
96    /**
97     * Setter for the SCM revision id of this changeset.
98     * @param revision the SCM revision id of this changeset.
99     */
100   public void setRevision( String revision )
101   {
102     this.revision = revision;
103   }
104 }