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.dmaap.dbcapi.model;
23 public class ReplicationVector {
25 public enum ReplicationVector_Status {
38 ReplicationVector_Status status;
40 public ReplicationVector(){
44 public ReplicationVector(String fqtn, String sourceCluster,
45 String targetCluster) {
48 this.sourceCluster = sourceCluster;
49 this.targetCluster = targetCluster;
52 public String getFqtn() {
56 public void setFqtn(String fqtn) {
60 public String getSourceCluster() {
64 public void setSourceCluster(String sourceCluster) {
65 this.sourceCluster = sourceCluster;
68 public String getTargetCluster() {
72 public void setTargetCluster(String targetCluster) {
73 this.targetCluster = targetCluster;
76 public int hashCode() {
77 StringBuilder tmp = new StringBuilder( this.fqtn );
78 tmp.append(this.sourceCluster);
79 tmp.append(this.targetCluster);
81 return tmp.toString().hashCode();
83 private static boolean xeq(String s1, String s2) {
87 return(s1.equals(s2));
90 public boolean equals(Object o) {
94 if (!(o instanceof ReplicationVector)) {
97 ReplicationVector x = (ReplicationVector)o;
98 return(xeq(fqtn, x.fqtn) && xeq(sourceCluster, x.sourceCluster) && xeq(targetCluster, x.targetCluster));