Test gson in policy-management
[policy/drools-pdp.git] / policy-management / src / main / java / org / onap / policy / drools / protocol / coders / EventProtocolParams.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2018 Samsung Electronics Co., Ltd. All rights reserved.
4  *  Modifications Copyright (C) 2019 AT&T Intellectual Property.
5  * ================================================================================
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * SPDX-License-Identifier: Apache-2.0
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.onap.policy.drools.protocol.coders;
23
24 import org.onap.policy.drools.protocol.coders.TopicCoderFilterConfiguration.CustomCoder;
25
26 public class EventProtocolParams {
27     private String groupId;
28     private String artifactId;
29     private String topic;
30     private String eventClass;
31     private JsonProtocolFilter protocolFilter;
32     private TopicCoderFilterConfiguration.CustomGsonCoder customGsonCoder;
33     private int modelClassLoaderHash;
34
35     public String getGroupId() {
36         return groupId;
37     }
38
39     public String getArtifactId() {
40         return artifactId;
41     }
42
43     public String getTopic() {
44         return topic;
45     }
46
47     public String getEventClass() {
48         return eventClass;
49     }
50
51     public JsonProtocolFilter getProtocolFilter() {
52         return protocolFilter;
53     }
54
55     public TopicCoderFilterConfiguration.CustomGsonCoder getCustomGsonCoder() {
56         return customGsonCoder;
57     }
58
59     public int getModelClassLoaderHash() {
60         return modelClassLoaderHash;
61     }
62
63     public static EventProtocolParams builder() {
64         return new EventProtocolParams();
65     }
66
67     /**
68      * Setter method.
69      *
70      * @param groupId of the controller
71      * @return EventProtocolParams
72      */
73     public EventProtocolParams groupId(String groupId) {
74         this.groupId = groupId;
75         return this;
76     }
77
78     /**
79      * Setter method.
80      *
81      * @param artifactId of the controller
82      * @return EventProtocolParams
83      */
84     public EventProtocolParams artifactId(String artifactId) {
85         this.artifactId = artifactId;
86         return this;
87     }
88
89     /**
90      * Setter method.
91      *
92      * @param topic the topic
93      * @return EventProtocolParams
94      */
95     public EventProtocolParams topic(String topic) {
96         this.topic = topic;
97         return this;
98     }
99
100     /**
101      * Setter method.
102      *
103      * @param eventClass the event class
104      * @return EventProtocolParams
105      */
106     public EventProtocolParams eventClass(String eventClass) {
107         this.eventClass = eventClass;
108         return this;
109     }
110
111     /**
112      * Setter method.
113      *
114      * @param protocolFilter filters to selectively choose a particular decoder
115      *                       when there are multiples
116      * @return EventProtocolParams
117      */
118     public EventProtocolParams protocolFilter(JsonProtocolFilter protocolFilter) {
119         this.protocolFilter = protocolFilter;
120         return this;
121     }
122
123     /**
124      * Setter method.
125      *
126      * @param customGsonCoder custom gscon coder
127      * @return EventProtocolParams
128      */
129     public EventProtocolParams customGsonCoder(
130             TopicCoderFilterConfiguration.CustomGsonCoder customGsonCoder) {
131         this.customGsonCoder = customGsonCoder;
132         return this;
133     }
134
135     /**
136      * Setter method.
137      * @param modelClassLoaderHash integer representing model hash
138      * @return EventProtocolParams
139      */
140     public EventProtocolParams modelClassLoaderHash(int modelClassLoaderHash) {
141         this.modelClassLoaderHash = modelClassLoaderHash;
142         return this;
143     }
144
145     public CustomCoder getCustomCoder() {
146         return this.customGsonCoder;
147     }
148 }