Merge "Add period after inheritDoc for Sonar"
[policy/apex-pdp.git] / auth / cli-editor / src / main / java / org / onap / policy / apex / auth / clieditor / CommandLineArgumentValue.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
4  * ================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  * 
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  * 
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  * 
17  * SPDX-License-Identifier: Apache-2.0
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.apex.auth.clieditor;
22
23 /**
24  * This class represents an argument used on a command and its value.
25  *
26  * @author Liam Fallon (liam.fallon@ericsson.com)
27  */
28 public class CommandLineArgumentValue {
29     private final CommandLineArgument cliArgument;
30     private boolean specified;
31     private String value;
32
33     /**
34      * The Constructor creates an argument value for the given argument, has not been set, and has
35      * no value.
36      *
37      * @param cliArgument the argument for which this object is a value
38      */
39     public CommandLineArgumentValue(final CommandLineArgument cliArgument) {
40         this.cliArgument = cliArgument;
41         specified = false;
42         value = null;
43     }
44
45     /**
46      * Gets the argument for which this object is a value.
47      *
48      * @return the argument for which this object is a value
49      */
50     public CommandLineArgument getCliArgument() {
51         return cliArgument;
52     }
53
54     /**
55      * Checks if the argument value is specified.
56      *
57      * @return true, if the argument value is specified
58      */
59     public boolean isSpecified() {
60         return specified;
61     }
62
63     /**
64      * Gets the argument value.
65      *
66      * @return the argument value
67      */
68     public String getValue() {
69         return value;
70     }
71
72     /**
73      * Sets the argument value.
74      *
75      * @param value the argument value
76      */
77     public void setValue(final String value) {
78         this.value = value;
79         specified = true;
80     }
81
82     /*
83      * (non-Javadoc)
84      * 
85      * @see java.lang.Object#toString()
86      */
87     @Override
88     public String toString() {
89         return "CLIArgumentValue [cliArgument=" + cliArgument + ", specified=" + specified + ", value=" + value + "]";
90     }
91 }