2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.so.client.dmaap.rest;
23 import java.util.Properties;
25 public class PropertiesBean {
27 private String username;
28 private String password;
29 private String environment;
30 private String partition;
31 private String contentType;
34 private String timeout;
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"));
47 public String getUsername() {
50 public void setUsername(String username) {
51 this.username = username;
53 public PropertiesBean withUsername(String username) {
54 this.username = username;
57 public String getPassword() {
60 public void setPassword(String password) {
61 this.password = password;
63 public PropertiesBean withPassword(String password) {
64 this.password = password;
67 public String getEnvironment() {
70 public void setEnvironment(String environment) {
71 this.environment = environment;
73 public PropertiesBean withEnvironment(String environment) {
74 this.environment = environment;
77 public String getPartition() {
80 public void setPartition(String partition) {
81 this.partition = partition;
83 public PropertiesBean withPartition(String partition) {
84 this.partition = partition;
87 public String getContentType() {
90 public void setContentType(String contentType) {
91 this.contentType = contentType;
93 public PropertiesBean withContentType(String contentType) {
94 this.contentType = contentType;
97 public String getHost() {
100 public void setHost(String host) {
103 public PropertiesBean withHost(String host) {
107 public String getTopic() {
110 public void setTopic(String topic) {
113 public PropertiesBean withTopic(String topic) {
117 public String getTimeout() {
120 public void setTimeout(String timeout) {
121 this.timeout = timeout;
123 public PropertiesBean withTimeout(String timeout) {
124 this.timeout = timeout;