2 * ============LICENSE_START=======================================================
3 * org.onap.dcaegen2.collectors.ves
4 * ================================================================================
5 * Copyright (C) 2018 Nokia. 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=========================================================
20 package org.onap.dcae.controller;
22 import java.util.Objects;
25 * @author Pawel Szalapski (pawel.szalapski@nokia.com)
27 final class EnvProps {
29 final String consulProtocol;
30 final String consulHost;
33 final String cbsProtocol;
36 EnvProps(String consulProtocol, String consulHost, int consulPort, String cbsProtocol, String cbsName, String appName) {
37 this.consulProtocol = consulProtocol;
38 this.consulHost = consulHost;
39 this.consulPort = consulPort;
40 this.cbsProtocol = cbsProtocol;
41 this.cbsName = cbsName;
42 this.appName = appName;
46 public String toString() {
48 "consulProtocol='" + consulProtocol + '\'' +
49 ", consulHost='" + consulHost + '\'' +
50 ", consulPort=" + consulPort +
51 ", cbsProtocol='" + cbsProtocol + '\'' +
52 ", cbsName='" + cbsName + '\'' +
53 ", appName='" + appName + '\'' +
58 public boolean equals(Object o) {
62 if (o == null || getClass() != o.getClass()) {
65 EnvProps envProps = (EnvProps) o;
66 return consulPort == envProps.consulPort &&
67 Objects.equals(consulProtocol, envProps.consulProtocol) &&
68 Objects.equals(consulHost, envProps.consulHost) &&
69 Objects.equals(cbsProtocol, envProps.cbsProtocol) &&
70 Objects.equals(cbsName, envProps.cbsName) &&
71 Objects.equals(appName, envProps.appName);
75 public int hashCode() {
76 return Objects.hash(consulProtocol, consulHost, consulPort, cbsProtocol, cbsName, appName);