Changing the license and trademark
[aai/sparky-be.git] / src / main / java / org / openecomp / sparky / config / oxm / OxmEntityDescriptor.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6  * Copyright © 2017 Amdocs
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *       http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  *
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  */
23 package org.openecomp.sparky.config.oxm;
24
25 import java.util.List;
26
27 import org.openecomp.sparky.synchronizer.entity.SuggestionSearchEntity;
28
29 /**
30  * The Class OxmEntityDescriptor.
31  */
32 public class OxmEntityDescriptor {
33
34   private String entityName;
35
36   private List<String> primaryKeyAttributeName;
37
38   private List<String> searchableAttributes;
39
40   private CrossEntityReference crossEntityReference;
41
42   private String geoLatName;
43
44   private String geoLongName;
45   
46   private SuggestionSearchEntity suggestionSearchEntity;
47
48   public String getEntityName() {
49     return entityName;
50   }
51
52   public void setEntityName(String entityName) {
53     this.entityName = entityName;
54   }
55
56   public List<String> getPrimaryKeyAttributeName() {
57     return primaryKeyAttributeName;
58   }
59
60   public void setPrimaryKeyAttributeName(List<String> primaryKeyAttributeName) {
61     this.primaryKeyAttributeName = primaryKeyAttributeName;
62   }
63
64   public List<String> getSearchableAttributes() {
65     return searchableAttributes;
66   }
67
68   public void setSearchableAttributes(List<String> searchableAttributes) {
69     this.searchableAttributes = searchableAttributes;
70   }
71
72   /**
73    * Checks for searchable attributes.
74    *
75    * @return true, if successful
76    */
77   public boolean hasSearchableAttributes() {
78
79     if (this.searchableAttributes == null) {
80       return false;
81     }
82
83     if (this.searchableAttributes.size() > 0) {
84       return true;
85     }
86
87     return false;
88
89   }
90
91   public CrossEntityReference getCrossEntityReference() {
92     return crossEntityReference;
93   }
94
95   public void setCrossEntityReference(CrossEntityReference crossEntityReference) {
96     this.crossEntityReference = crossEntityReference;
97   }
98
99   /**
100    * Checks for cross entity references.
101    *
102    * @return true, if successful
103    */
104   public boolean hasCrossEntityReferences() {
105     if (this.crossEntityReference == null) {
106       return false;
107     }
108     if (!this.crossEntityReference.getReferenceAttributes().isEmpty()) {
109       return true;
110     }
111     return false;
112   }
113
114   public String getGeoLatName() {
115     return geoLatName;
116   }
117
118   public void setGeoLatName(String geoLatName) {
119     this.geoLatName = geoLatName;
120   }
121
122   public String getGeoLongName() {
123     return geoLongName;
124   }
125
126   public void setGeoLongName(String geoLongName) {
127     this.geoLongName = geoLongName;
128   }
129
130   /**
131    * Checks for geo entity.
132    *
133    * @return true, if successful
134    */
135   public boolean hasGeoEntity() {
136
137     if (this.geoLongName != null && this.geoLatName != null) {
138       return true;
139     }
140
141     return false;
142
143   }
144   
145   public SuggestionSearchEntity getSuggestionSearchEntity() {
146     return this.suggestionSearchEntity;
147   }
148   
149   public void setSuggestionSearchEntity(SuggestionSearchEntity suggestionSearchEntity) {
150     this.suggestionSearchEntity = suggestionSearchEntity;
151   }
152   
153   /**
154    * Checks for non-null, populated SuggestionSearchEntity.
155    *
156    * @return true, if successful
157    */
158   public boolean hasSuggestionSearchEntity() {
159     if (this.suggestionSearchEntity == null) {
160       return false;
161     }
162     if (!this.suggestionSearchEntity.getSuggestionConnectorWords().isEmpty()) {
163       return true;
164     }
165     return false;
166   }
167   
168   @Override
169   public String toString() {
170     return "OxmEntityDescriptor [entityName=" + entityName + ", primaryKeyAttributeName="
171         + primaryKeyAttributeName + ", searchableAttributes=" + searchableAttributes
172         + ", crossEntityReference=" + crossEntityReference + ", geoLatName=" + geoLatName
173         + ", geoLongName=" + geoLongName + ", suggestionSearchEntity=" + suggestionSearchEntity
174         + "]";
175   }
176 }