View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.scm;
20  
21  import java.io.Serializable;
22  
23  /**
24   * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
25   */
26  public class CommandParameter implements Serializable {
27      private static final long serialVersionUID = -3391190831054016735L;
28  
29      public static final CommandParameter BINARY = new CommandParameter("binary");
30  
31      public static final CommandParameter RECURSIVE = new CommandParameter("recursive");
32  
33      public static final CommandParameter SHALLOW = new CommandParameter("shallow");
34  
35      public static final CommandParameter MESSAGE = new CommandParameter("message");
36  
37      public static final CommandParameter BRANCH_NAME = new CommandParameter("branchName");
38  
39      public static final CommandParameter START_DATE = new CommandParameter("startDate");
40  
41      public static final CommandParameter END_DATE = new CommandParameter("endDate");
42  
43      public static final CommandParameter NUM_DAYS = new CommandParameter("numDays");
44  
45      public static final CommandParameter LIMIT = new CommandParameter("limit");
46  
47      public static final CommandParameter BRANCH = new CommandParameter("branch");
48  
49      public static final CommandParameter START_SCM_VERSION = new CommandParameter("startScmVersion");
50  
51      public static final CommandParameter END_SCM_VERSION = new CommandParameter("endScmVersion");
52  
53      public static final CommandParameter CHANGELOG_DATE_PATTERN = new CommandParameter("changelogDatePattern");
54  
55      public static final CommandParameter SCM_VERSION = new CommandParameter("scmVersion");
56  
57      public static final CommandParameter TAG_NAME = new CommandParameter("tagName");
58  
59      public static final CommandParameter FILE = new CommandParameter("file");
60  
61      public static final CommandParameter FILES = new CommandParameter("files");
62  
63      public static final CommandParameter OUTPUT_FILE = new CommandParameter("outputFile");
64  
65      public static final CommandParameter OUTPUT_DIRECTORY = new CommandParameter("outputDirectory");
66  
67      public static final CommandParameter RUN_CHANGELOG_WITH_UPDATE = new CommandParameter("run_changelog_with_update");
68  
69      public static final CommandParameter SCM_TAG_PARAMETERS = new CommandParameter("ScmTagParameters");
70  
71      public static final CommandParameter SCM_BRANCH_PARAMETERS = new CommandParameter("ScmBranchParameters");
72  
73      public static final CommandParameter SCM_MKDIR_CREATE_IN_LOCAL = new CommandParameter("createInLocal");
74  
75      /**
76       * Parameter used only for Git SCM to truncate the emitted hash to the given character length, simulates <code>git rev-parse --short=length</code> command.
77       *
78       * @since 1.7
79       */
80      public static final CommandParameter SCM_SHORT_REVISION_LENGTH = new CommandParameter("shortRevisionLength");
81  
82      /**
83       * Parameter to force add.
84       *
85       * @since 1.7
86       */
87      public static final CommandParameter FORCE_ADD = new CommandParameter("forceAdd");
88  
89      /**
90       * Contains true or false.
91       *
92       * @since 1.8
93       */
94      public static final CommandParameter IGNORE_WHITESPACE = new CommandParameter("ignoreWhitespace");
95  
96      /**
97       * Parameter to indicate whether the commit/tag should be signed or not.
98       * This is only applicable to Git for now.
99       * Possible values are outlined in {@link CommandParameters.SignOption}
100      *
101      * @since 2.2.1
102      */
103     public static final CommandParameter SIGN_OPTION = new CommandParameter("sign");
104 
105     /**
106      * Parameter name.
107      */
108     private String name;
109 
110     /**
111      * @param name the parameter name
112      */
113     private CommandParameter(String name) {
114         this.name = name;
115     }
116 
117     /**
118      * @return the parameter name
119      */
120     public String getName() {
121         return name;
122     }
123 
124     public String toString() {
125         return name;
126     }
127 }