001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *   http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019package org.apache.maven.scm;
020
021import java.io.Serializable;
022
023/**
024 * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
025 */
026public class CommandParameter implements Serializable {
027    private static final long serialVersionUID = -3391190831054016735L;
028
029    public static final CommandParameter BINARY = new CommandParameter("binary");
030
031    public static final CommandParameter RECURSIVE = new CommandParameter("recursive");
032
033    public static final CommandParameter SHALLOW = new CommandParameter("shallow");
034
035    public static final CommandParameter MESSAGE = new CommandParameter("message");
036
037    public static final CommandParameter BRANCH_NAME = new CommandParameter("branchName");
038
039    public static final CommandParameter START_DATE = new CommandParameter("startDate");
040
041    public static final CommandParameter END_DATE = new CommandParameter("endDate");
042
043    public static final CommandParameter NUM_DAYS = new CommandParameter("numDays");
044
045    public static final CommandParameter LIMIT = new CommandParameter("limit");
046
047    public static final CommandParameter BRANCH = new CommandParameter("branch");
048
049    public static final CommandParameter START_SCM_VERSION = new CommandParameter("startScmVersion");
050
051    public static final CommandParameter END_SCM_VERSION = new CommandParameter("endScmVersion");
052
053    public static final CommandParameter CHANGELOG_DATE_PATTERN = new CommandParameter("changelogDatePattern");
054
055    public static final CommandParameter SCM_VERSION = new CommandParameter("scmVersion");
056
057    public static final CommandParameter TAG_NAME = new CommandParameter("tagName");
058
059    public static final CommandParameter FILE = new CommandParameter("file");
060
061    public static final CommandParameter FILES = new CommandParameter("files");
062
063    public static final CommandParameter OUTPUT_FILE = new CommandParameter("outputFile");
064
065    public static final CommandParameter OUTPUT_DIRECTORY = new CommandParameter("outputDirectory");
066
067    public static final CommandParameter RUN_CHANGELOG_WITH_UPDATE = new CommandParameter("run_changelog_with_update");
068
069    public static final CommandParameter SCM_TAG_PARAMETERS = new CommandParameter("ScmTagParameters");
070
071    public static final CommandParameter SCM_BRANCH_PARAMETERS = new CommandParameter("ScmBranchParameters");
072
073    public static final CommandParameter SCM_MKDIR_CREATE_IN_LOCAL = new CommandParameter("createInLocal");
074
075    /**
076     * 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.
077     *
078     * @since 1.7
079     */
080    public static final CommandParameter SCM_SHORT_REVISION_LENGTH = new CommandParameter("shortRevisionLength");
081
082    /**
083     * Parameter to force add.
084     *
085     * @since 1.7
086     */
087    public static final CommandParameter FORCE_ADD = new CommandParameter("forceAdd");
088
089    /**
090     * Contains true or false.
091     *
092     * @since 1.8
093     */
094    public static final CommandParameter IGNORE_WHITESPACE = new CommandParameter("ignoreWhitespace");
095
096    /**
097     * Parameter to indicate whether the commit/tag should be signed or not.
098     * This is only applicable to Git for now.
099     * 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}