2 * ============LICENSE_START===================================================
3 * SPARKY (AAI UI service)
4 * ============================================================================
5 * Copyright © 2017 AT&T Intellectual Property.
6 * Copyright © 2017 Amdocs
8 * ============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=====================================================
22 * ECOMP and OpenECOMP are trademarks
23 * and service marks of AT&T Intellectual Property.
26 package org.openecomp.sparky.config.oxm;
28 import java.util.List;
30 import org.openecomp.sparky.synchronizer.entity.SuggestionSearchEntity;
33 * The Class OxmEntityDescriptor.
35 public class OxmEntityDescriptor {
37 private String entityName;
39 private List<String> primaryKeyAttributeName;
41 private List<String> searchableAttributes;
43 private CrossEntityReference crossEntityReference;
45 private String geoLatName;
47 private String geoLongName;
49 private SuggestionSearchEntity suggestionSearchEntity;
51 public String getEntityName() {
55 public void setEntityName(String entityName) {
56 this.entityName = entityName;
59 public List<String> getPrimaryKeyAttributeName() {
60 return primaryKeyAttributeName;
63 public void setPrimaryKeyAttributeName(List<String> primaryKeyAttributeName) {
64 this.primaryKeyAttributeName = primaryKeyAttributeName;
67 public List<String> getSearchableAttributes() {
68 return searchableAttributes;
71 public void setSearchableAttributes(List<String> searchableAttributes) {
72 this.searchableAttributes = searchableAttributes;
76 * Checks for searchable attributes.
78 * @return true, if successful
80 public boolean hasSearchableAttributes() {
82 if (this.searchableAttributes == null) {
86 if (this.searchableAttributes.size() > 0) {
94 public CrossEntityReference getCrossEntityReference() {
95 return crossEntityReference;
98 public void setCrossEntityReference(CrossEntityReference crossEntityReference) {
99 this.crossEntityReference = crossEntityReference;
103 * Checks for cross entity references.
105 * @return true, if successful
107 public boolean hasCrossEntityReferences() {
108 if (this.crossEntityReference == null) {
111 if (!this.crossEntityReference.getReferenceAttributes().isEmpty()) {
117 public String getGeoLatName() {
121 public void setGeoLatName(String geoLatName) {
122 this.geoLatName = geoLatName;
125 public String getGeoLongName() {
129 public void setGeoLongName(String geoLongName) {
130 this.geoLongName = geoLongName;
134 * Checks for geo entity.
136 * @return true, if successful
138 public boolean hasGeoEntity() {
140 if (this.geoLongName != null && this.geoLatName != null) {
148 public SuggestionSearchEntity getSuggestionSearchEntity() {
149 return this.suggestionSearchEntity;
152 public void setSuggestionSearchEntity(SuggestionSearchEntity suggestionSearchEntity) {
153 this.suggestionSearchEntity = suggestionSearchEntity;
157 * Checks for non-null, populated SuggestionSearchEntity.
159 * @return true, if successful
161 public boolean hasSuggestionSearchEntity() {
162 if (this.suggestionSearchEntity == null) {
165 if (!this.suggestionSearchEntity.getSuggestionConnectorWords().isEmpty()) {
172 public String toString() {
173 return "OxmEntityDescriptor [entityName=" + entityName + ", primaryKeyAttributeName="
174 + primaryKeyAttributeName + ", searchableAttributes=" + searchableAttributes
175 + ", crossEntityReference=" + crossEntityReference + ", geoLatName=" + geoLatName
176 + ", geoLongName=" + geoLongName + ", suggestionSearchEntity=" + suggestionSearchEntity