7188e3558b29515ec5dfd8ce995679d8b2c3da22
[policy/engine.git] / ONAP-REST / src / main / java / org / onap / policy / rest / adapter / Term.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP 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.onap.policy.rest.adapter;
22
23
24
25 import java.util.ArrayList;
26 import java.util.HashSet;
27 import java.util.List;
28 import java.util.Set;
29
30
31 public class Term {
32         
33         String position;
34         protected String ruleName;
35         protected List<String> fromZones;  
36         protected List<String> toZones;
37         protected boolean negateSource; //hardcoded
38         protected boolean negateDestination; //hardcoded
39         protected List<AddressJson> sourceList;
40         protected List<AddressJson> destinationList;
41         protected List<ServicesJson> sourceServices;
42         protected Set<ServicesJson> destServices;
43         protected String action;
44         protected String description;
45         boolean enabled;  //hardcoded
46         boolean log;      //hardcoded
47         
48         //position
49     public String getPosition() {
50         return position;
51     }
52     
53     public void setPosition(String value) {
54         this.position = value;
55     }
56     
57     //RuleName
58     public String getRuleName() {
59         return ruleName;
60     }
61     
62     public void setRuleName(String value) {
63         this.ruleName = value;
64     }
65     
66     //From Zone
67     public  List<String> getFromZones() {
68         if (fromZones==null)
69         {
70                 fromZones= new ArrayList<String>();
71         }
72         return fromZones;
73     }
74     
75     public void setFromZones(List<String> fromZones) {
76         this.fromZones = fromZones;
77     }
78     
79     //To Zone
80     public  List<String> getToZones() {
81         if (toZones==null)
82         {
83                 toZones= new ArrayList<String>();
84         }
85         return toZones;
86     }
87     
88     public void setToZones(List<String> toZones) {
89         this.toZones = toZones;
90     }
91    
92     
93     //Negate Source
94     public boolean getNegateSource() {
95         return negateSource;
96     }
97     
98     public void setNegateSource(boolean negateSource) {
99         this.negateSource = negateSource;
100     }
101     
102     //Negate Destination
103     public boolean getNegateDestination() {
104         return negateDestination;
105     }
106     
107     public void setNegateDestination(boolean negateDestination) {
108         this.negateDestination = negateDestination;
109     }
110     
111     //SourceList
112     public List<AddressJson> getSourceList() 
113     {
114         if(sourceList==null)
115         {
116                 sourceList= new ArrayList<AddressJson>();
117         }
118         return this.sourceList;
119     }
120
121     public void setSourceList(List<AddressJson> srcList) {
122         this.sourceList = srcList;
123     }
124     
125     //Destination List
126     public List<AddressJson> getDestinationList() 
127     {
128         if(destinationList==null)
129         {
130                 destinationList= new ArrayList<AddressJson>();
131         }
132         return this.destinationList;
133     }
134
135     public void setDestinationList(List<AddressJson> destList) {
136         this.destinationList = destList;
137     }
138     
139     //Source Services
140     public List<ServicesJson> getSourceServices() {
141         if(sourceServices==null)
142         {
143                 sourceServices= new ArrayList<ServicesJson>();
144         }
145         return this.sourceServices;
146     }
147
148     public void setSourceServices(List<ServicesJson> sourceServices) {
149         this.sourceServices = sourceServices;
150     }
151         
152     //Destination services. 
153     public Set<ServicesJson> getDestServices() {
154         if(destServices==null)
155         {
156                 destServices= new HashSet<ServicesJson>();
157         }
158         return this.destServices;
159     }
160
161     public void setDestServices(Set<ServicesJson> destServices) {
162         this.destServices = destServices;
163     }
164          
165         //Action
166     public String getAction() {
167         return action;
168     }
169     
170     public void setAction(String value) {
171         this.action = value;
172     }
173     
174     //description
175     public String getDescription() {
176         return description;
177     }
178     
179     public void setDescription(String desc) {
180         this.description = desc;
181     }
182       
183     //enabled
184     public boolean getEnabled() {
185         return enabled;
186     }
187     
188     public void setEnabled(boolean value) {
189         this.enabled = value;
190     }
191     
192     //Log
193     public boolean getLog() {
194         return log;
195     }
196     
197     public void setLog(boolean value) {
198         this.log = value;
199     }
200
201 }