2 * Copyright 2017 Huawei Technologies Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.onap.cli.fw.output;
19 import java.util.ArrayList;
20 import java.util.Arrays;
21 import java.util.List;
23 import org.onap.cli.fw.input.OnapCommandParameterType;
26 * Oclip command output records, helps to define the title and its description while command is defined and during run
27 * time, it captures the value of the output as well.
29 public class OnapCommandResultAttribute {
34 private String outName;
39 private String outDescription;
42 * Output values, in case list out, it holds values for all rows for show output, it will have one value
44 private List<String> values = new ArrayList<>();
47 * default value, useful to set when a command want to set the default value for a output attributes.
49 private String defaultValue = "";
54 private OnapCommandResultAttributeScope outScope = OnapCommandResultAttributeScope.SHORT;
56 private OnapCommandParameterType paramType = OnapCommandParameterType.STRING;
58 private boolean isSecured = false;
60 public void setValues(List<String> values) {
64 public String getName() {
68 public void setName(String name) {
72 public String getDescription() {
73 return outDescription;
76 public void setDescription(String description) {
77 this.outDescription = description;
80 public List<String> getValues() {
81 if (this.values.isEmpty() && !this.defaultValue.isEmpty()) {
82 return Arrays.asList(new String [] {this.defaultValue});
87 public OnapCommandResultAttributeScope getScope() {
91 public void setScope(OnapCommandResultAttributeScope scope) {
92 this.outScope = scope;
95 public OnapCommandParameterType getType() {
99 public void setType(OnapCommandParameterType type) {
100 this.paramType = type;
103 public boolean isSecured() {
107 public void setSecured(boolean isSecured) {
108 this.isSecured = isSecured;
111 public String getDefaultValue() {
115 public void setDefaultValue(String defaultValue) {
116 this.defaultValue = defaultValue;