Containerization feature of SO
[so.git] / common / src / main / java / org / onap / so / client / dmaap / rest / PropertiesBean.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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.so.client.dmaap.rest;
22
23 import java.util.Properties;
24
25 public class PropertiesBean {
26
27         private String username;
28         private String password;
29         private String environment;
30         private String partition;
31         private String contentType;
32         private String host;
33         private String topic;
34         private String timeout;
35         
36         
37         public PropertiesBean(Properties properties) {
38                 this.withUsername(properties.getProperty("username"))
39                 .withPassword(properties.getProperty("password"))
40                 .withTopic(properties.getProperty("topic"))
41                 .withEnvironment(properties.getProperty("environment"))
42                 .withHost(properties.getProperty("host"))
43                 .withTimeout(properties.getProperty("timeout", "20000"))
44                 .withPartition(properties.getProperty("partition"))
45                 .withContentType(properties.getProperty("contentType", "application/json"));
46         }
47         public String getUsername() {
48                 return username;
49         }
50         public void setUsername(String username) {
51                 this.username = username;
52         }
53         public PropertiesBean withUsername(String username) {
54                 this.username = username;
55                 return this;
56         }
57         public String getPassword() {
58                 return password;
59         }
60         public void setPassword(String password) {
61                 this.password = password;
62         }
63         public PropertiesBean withPassword(String password) {
64                 this.password = password;
65                 return this;
66         }
67         public String getEnvironment() {
68                 return environment;
69         }
70         public void setEnvironment(String environment) {
71                 this.environment = environment;
72         }
73         public PropertiesBean withEnvironment(String environment) {
74                 this.environment = environment;
75                 return this;
76         }
77         public String getPartition() {
78                 return partition;
79         }
80         public void setPartition(String partition) {
81                 this.partition = partition;
82         }
83         public PropertiesBean withPartition(String partition) {
84                 this.partition = partition;
85                 return this;
86         }
87         public String getContentType() {
88                 return contentType;
89         }
90         public void setContentType(String contentType) {
91                 this.contentType = contentType;
92         }
93         public PropertiesBean withContentType(String contentType) {
94                 this.contentType = contentType;
95                 return this;
96         }
97         public String getHost() {
98                 return host;
99         }
100         public void setHost(String host) {
101                 this.host = host;
102         }
103         public PropertiesBean withHost(String host) {
104                 this.host = host;
105                 return this;
106         }
107         public String getTopic() {
108                 return topic;
109         }
110         public void setTopic(String topic) {
111                 this.topic = topic;
112         }
113         public PropertiesBean withTopic(String topic) {
114                 this.topic = topic;
115                 return this;
116         }
117         public String getTimeout() {
118                 return timeout;
119         }
120         public void setTimeout(String timeout) {
121                 this.timeout = timeout;
122         }
123         public PropertiesBean withTimeout(String timeout) {
124                 this.timeout = timeout;
125                 return this;
126         }
127         
128         
129         
130         
131 }