1 package org.apache.maven.changelog;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 /**
22 * A set of information about revisions of a file as returned by CVS's log
23 * command
24 * @task remove previous revision along with parser changes
25 * @author <a href="mailto:dion@multitask.com.au">dIon Gillard</a>
26 * @version $Id: ChangeLogFile.java 532339 2007-04-25 12:28:56Z ltheussl $
27 */
28 public class ChangeLogFile
29 {
30 /** the name of the file relative to the project directory. */
31 private String name;
32
33 /** the latest revision of the file. */
34 private String revision;
35
36 /**
37 * Constructor for the ChangeLogFile object without all details available
38 * @param name file name
39 */
40 public ChangeLogFile( String name )
41 {
42 setName( name );
43 }
44
45 /**
46 * Constructor for the ChangeLogFile object
47 *
48 * @param name file name
49 * @param rev latest revision of the file
50 */
51 public ChangeLogFile( String name, String rev )
52 {
53 setName( name );
54 setRevision( rev );
55 }
56
57 /**
58 * Gets the name attribute of the ChangeLogFile object.
59 * @return the file name
60 */
61 public String getName()
62 {
63 return name;
64 }
65
66 /**
67 * Gets the revision attribute of the ChangeLogFile object.
68 * @return the latest revision of the file
69 */
70 public String getRevision()
71 {
72 return revision;
73 }
74
75 /**
76 * Setter for property name.
77 * @param name New value of property name.
78 */
79 public void setName( String name )
80 {
81 this.name = name;
82 }
83
84 /**
85 * Setter for property revision.
86 * @param revision New value of property revision.
87 */
88 public void setRevision( String revision )
89 {
90 this.revision = revision;
91 }
92
93 /**
94 * Provide a version of the object as a string for debugging purposes
95 * @return a {@link String} made up of the properties of the object
96 */
97 public String toString()
98 {
99 StringBuffer buffer = new StringBuffer( getName() );
100
101 if ( getRevision() != null )
102 {
103 buffer.append( ", " ).append( getRevision() );
104 }
105
106 return buffer.toString();
107 }
108 }
109