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 {
29 private String environment;
30 private String partition;
31 private String contentType;
34 private String timeout;
37 public PropertiesBean(Properties properties) {
38 this.withAuth(properties.getProperty("auth")).withKey(properties.getProperty("key"))
39 .withTopic(properties.getProperty("topic")).withEnvironment(properties.getProperty("environment"))
40 .withHost(properties.getProperty("host")).withTimeout(properties.getProperty("timeout", "20000"))
41 .withPartition(properties.getProperty("partition"))
42 .withContentType(properties.getProperty("contentType", "application/json"));
45 public String getAuth() {
49 public void setAuth(String auth) {
53 public PropertiesBean withAuth(String auth) {
58 public String getKey() {
62 public void setKey(String key) {
66 public PropertiesBean withKey(String key) {
71 public String getEnvironment() {
75 public void setEnvironment(String environment) {
76 this.environment = environment;
79 public PropertiesBean withEnvironment(String environment) {
80 this.environment = environment;
84 public String getPartition() {
88 public void setPartition(String partition) {
89 this.partition = partition;
92 public PropertiesBean withPartition(String partition) {
93 this.partition = partition;
97 public String getContentType() {
101 public void setContentType(String contentType) {
102 this.contentType = contentType;
105 public PropertiesBean withContentType(String contentType) {
106 this.contentType = contentType;
110 public String getHost() {
114 public void setHost(String host) {
118 public PropertiesBean withHost(String host) {
123 public String getTopic() {
127 public void setTopic(String topic) {
131 public PropertiesBean withTopic(String topic) {
136 public String getTimeout() {
140 public void setTimeout(String timeout) {
141 this.timeout = timeout;
144 public PropertiesBean withTimeout(String timeout) {
145 this.timeout = timeout;