/* * Copyright 2014-2016 CyberVision, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.kaaproject.kaa.common.dto; import java.io.Serializable; import java.util.List; public class EndpointGroupDto implements HasId, Serializable { private static final long serialVersionUID = 7185524720321264103L; private String id; private String name; private String description; private String createdUsername; private long createdTime; private String applicationId; private int weight; private int sequenceNumber; private List<String> topics; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getCreatedUsername() { return createdUsername; } public void setCreatedUsername(String createdUsername) { this.createdUsername = createdUsername; } public long getCreatedTime() { return createdTime; } public void setCreatedTime(long createdTime) { this.createdTime = createdTime; } public String getApplicationId() { return applicationId; } public void setApplicationId(String applicationId) { this.applicationId = applicationId; } public int getWeight() { return weight; } public void setWeight(int weight) { this.weight = weight; } public int getSequenceNumber() { return sequenceNumber; } public void setSequenceNumber(int sequenceNumber) { this.sequenceNumber = sequenceNumber; } public List<String> getTopics() { return topics; } public void setTopics(List<String> topics) { this.topics = topics; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } EndpointGroupDto that = (EndpointGroupDto) obj; if (sequenceNumber != that.sequenceNumber) { return false; } if (weight != that.weight) { return false; } if (applicationId != null ? !applicationId.equals(that.applicationId) : that.applicationId != null) { return false; } if (name != null ? !name.equals(that.name) : that.name != null) { return false; } if (topics != null ? !topics.equals(that.topics) : that.topics != null) { return false; } return true; } @Override public int hashCode() { int result = name != null ? name.hashCode() : 0; result = 31 * result + (applicationId != null ? applicationId.hashCode() : 0); result = 31 * result + weight; result = 31 * result + sequenceNumber; result = 31 * result + (topics != null ? topics.hashCode() : 0); return result; } @Override public String toString() { return "EndpointGroupDto{" + "id='" + id + '\'' + ", name='" + name + '\'' + ", applicationId='" + applicationId + '\'' + ", weight=" + weight + ", sequenceNumber=" + sequenceNumber + ", topics=" + topics + '}'; } public int incrementSecNum() { return ++sequenceNumber; } }