Release 1.7.3 DCAEGEN2 VESCollector container
[dcaegen2/collectors/ves.git] / src / main / java / org / onap / dcae / controller / EnvProps.java
1 /*-
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
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 package org.onap.dcae.controller;
21
22 import java.util.Objects;
23
24 /**
25  * @author Pawel Szalapski (pawel.szalapski@nokia.com)
26  */
27 final class EnvProps {
28
29     final String consulProtocol;
30     final String consulHost;
31     final int consulPort;
32     final String cbsName;
33     final String cbsProtocol;
34     final String appName;
35
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;
43     }
44
45     @Override
46     public String toString() {
47         return "EnvProps{" +
48             "consulProtocol='" + consulProtocol + '\'' +
49             ", consulHost='" + consulHost + '\'' +
50             ", consulPort=" + consulPort +
51             ", cbsProtocol='" + cbsProtocol + '\'' +
52             ", cbsName='" + cbsName + '\'' +
53             ", appName='" + appName + '\'' +
54             '}';
55     }
56
57     @Override
58     public boolean equals(Object o) {
59         if (this == o) {
60             return true;
61         }
62         if (o == null || getClass() != o.getClass()) {
63             return false;
64         }
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);
72     }
73
74     @Override
75     public int hashCode() {
76         return Objects.hash(consulProtocol, consulHost, consulPort, cbsProtocol, cbsName, appName);
77     }
78 }