Policy TestSuite Enabled
[policy/engine.git] / ECOMP-REST / src / main / java / org / openecomp / policy / rest / adapter / AddressGroupJson.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ECOMP Policy Engine
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.policy.rest.adapter;
22
23
24 import java.util.ArrayList;
25 import java.util.List;
26
27 public class AddressGroupJson {
28
29         protected String name;
30         protected String description;
31         protected List<AddressMembers> members;
32         
33         // name
34         public String getName() {
35                 return name;
36         }
37
38         public void setName(String value) {
39                 this.name = value;
40         }
41         
42         public boolean equals(Object obj){
43                 if(obj != null){
44                         AddressGroupJson servGroupobj=(AddressGroupJson) obj;
45                         if(this.getName().equals(servGroupobj.getName())){
46                                 return true;
47                         }       
48                 }
49                 return false;
50         }
51         
52          public int hashCode() {
53             return Integer.valueOf(name.charAt(0)+(name.charAt(1)));
54          }
55         
56         // description
57         public String getDescription() {
58                 return description;
59         }
60
61         public void setDescription(String value) {
62                 this.description = value;
63         }
64         
65         public List<AddressMembers> getMembers() 
66     {
67         if(members==null)
68         {
69                 members= new ArrayList<AddressMembers>();
70         }
71         return this.members;
72     }
73
74         public void setMembers(List<AddressMembers> members) 
75         {
76                 this.members = members;
77         }
78
79 }