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 org.onap.cli.fw.error.OnapCommandInvalidResultAttributeScope;
22 * Oclip command supports to print output with given set of defined attributes, and each attributes are marked with this
26 public enum OnapCommandResultAttributeScope {
28 * By default, all output attributes which are tagged with short would be printed.
32 * When user provides --long or -l, all attributes including short tagged will be printed. otherwise, attributes
33 * tagged with long, whould be ignored as part of output
38 * get attribute scope enum type.
43 * @throws OnapCommandInvalidResultAttributeScope
46 public static OnapCommandResultAttributeScope get(String name) throws OnapCommandInvalidResultAttributeScope {
47 if (LONG.name().equalsIgnoreCase(name)) {
49 } else if (SHORT.name().equalsIgnoreCase(name)) {
53 throw new OnapCommandInvalidResultAttributeScope(name);