1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package nl.toolforge.karma.core;
20
21 /***
22 * @author D.A. Smedes
23 * @version $Id: Patch.java,v 1.6 2004/11/02 22:57:08 amooy Exp $
24 */
25 public class Patch extends Version {
26
27 public static final String PATCH_PATTERN_POSTFIX = "-{1}//d{1,2}";
28
29 /***
30 * Override for {@link Version.VERSION_PATTERN_STRING}. A patch can have one more digit.
31 *
32 * @see #PATCH_PATTERN_POSTFIX
33 */
34 public static final String VERSION_PATTERN_STRING = Version.VERSION_PATTERN_STRING + PATCH_PATTERN_POSTFIX;
35
36 public static int INITIAL_PATCH = 1;
37
38 /***
39 * Patches have the following format : <code>0-0-x</code>, where x is the actual patch number within the
40 * <code>0-0</code> version. The full thing has to be provided.
41 *
42 * @param patchNumber
43 */
44 public Patch(String patchNumber) {
45 super(patchNumber);
46 }
47
48 public String getPatternString() {
49 return VERSION_PATTERN_STRING;
50 }
51
52 /***
53 * Overridden to throw an IllegalStateException because you cannot increase the major
54 * version number of a patch version.
55 * @see nl.toolforge.karma.core.Version#increaseMajor()
56 */
57 public void increaseMajor() {
58 throw new IllegalStateException("IncreaseMajor() is not supported for patch versions.");
59 }
60 }