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.schema;
19 import java.util.ArrayList;
20 import java.util.List;
21 import java.util.Objects;
23 import org.onap.cli.fw.cmd.OnapCommandType;
24 import org.onap.cli.fw.conf.OnapCommandConstants;
25 import org.onap.cli.fw.info.OnapCommandState;
28 * OnapCommandSchemaInfo is used in discovery caching.
31 public class OnapCommandSchemaInfo implements Comparable<OnapCommandSchemaInfo> {
34 * Name of the schema file name
36 private String schemaName;
39 * Schema location in complete path
41 private String schemaURI;
43 private String cmdName;
45 private String product;
47 private List<String> sampleFiles = new ArrayList();
52 private String version;
54 private String type = OnapCommandType.CMD.name();
56 private String schemaProfile = OnapCommandConstants.BASIC_SCHEMA_PROFILE;
58 private String ignore = OnapCommandConstants.BOOLEAN_FALSE;
60 private String state = OnapCommandState.STABLE.name();
62 public String getSchemaName() {
66 public void setSchemaName(String schemaName) {
67 this.schemaName = schemaName;
70 public String getCmdName() {
74 public void setCmdName(String cmdName) {
75 this.cmdName = cmdName;
78 public String getVersion() {
82 public void setVersion(String version) {
83 this.version = version;
86 public String getProduct() {
90 public void setProduct(String cmdVersion) {
91 this.product = cmdVersion;
94 public String getSchemaURI() {
98 public void setSchemaURI(String schemaURI) {
99 this.schemaURI = schemaURI;
102 public String getSchemaProfile() {
103 return schemaProfile;
106 public void setSchemaProfile(String internal) {
107 this.schemaProfile = internal;
110 public String getType() {
114 public void setType(String type) {
118 public boolean isIgnore() {
119 return OnapCommandConstants.BOOLEAN_TRUE.equalsIgnoreCase(this.getIgnore());
122 public String getIgnore() {
126 public void setIgnore(String ignore) {
127 this.ignore = ignore;
130 public List<String> getSampleFiles() {
134 public String getState() {
138 public void setState(String state) {
143 public int compareTo(OnapCommandSchemaInfo o) {
144 return this.cmdName.compareTo(o.getCmdName());
148 public boolean equals(Object obj) {
152 if (this.getClass() != obj.getClass())
155 return this.compareTo((OnapCommandSchemaInfo) obj) == 0;
160 public int hashCode() {
161 return Objects.hashCode(this.cmdName);