/*
* The MIT License
*
* Copyright 2014 Miroslav Cupak (mirocupak@gmail.com).
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.dnastack.bob.service.dto;
import java.io.Serializable;
import java.util.Objects;
import java.util.Set;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Beacon DTO.
*
* @author Miroslav Cupak (mirocupak@gmail.com)
* @version 1.0
*/
@XmlRootElement(name = "beacon")
@XmlType(name = "beacon")
public class BeaconDto implements Serializable {
private static final long serialVersionUID = 42L;
private String id;
private String name;
private String url;
private String organization;
private String description;
private String homePage;
private String email;
private boolean aggregator;
private boolean visible;
private boolean enabled;
private Set<ReferenceDto> supportedReferences;
public BeaconDto() {
// needed for JAXB
}
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 getOrganization() {
return organization;
}
public void setOrganization(String organization) {
this.organization = organization;
}
public boolean isAggregator() {
return aggregator;
}
public void setAggregator(boolean aggregator) {
this.aggregator = aggregator;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getHomePage() {
return homePage;
}
public void setHomePage(String homePage) {
this.homePage = homePage;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public Set<ReferenceDto> getSupportedReferences() {
return supportedReferences;
}
public void setSupportedReferences(Set<ReferenceDto> supportedReferences) {
this.supportedReferences = supportedReferences;
}
public boolean isVisible() {
return visible;
}
public void setVisible(boolean visible) {
this.visible = visible;
}
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
@Override
public int hashCode() {
int hash = 7;
hash = 29 * hash + Objects.hashCode(this.id);
hash = 29 * hash + Objects.hashCode(this.name);
hash = 29 * hash + Objects.hashCode(this.url);
hash = 29 * hash + Objects.hashCode(this.organization);
hash = 29 * hash + Objects.hashCode(this.description);
hash = 29 * hash + Objects.hashCode(this.homePage);
hash = 29 * hash + Objects.hashCode(this.email);
hash = 29 * hash + (this.aggregator ? 1 : 0);
hash = 29 * hash + (this.visible ? 1 : 0);
hash = 29 * hash + (this.enabled ? 1 : 0);
hash = 29 * hash + Objects.hashCode(this.supportedReferences);
return hash;
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final BeaconDto other = (BeaconDto) obj;
if (!Objects.equals(this.id, other.id)) {
return false;
}
if (!Objects.equals(this.name, other.name)) {
return false;
}
if (!Objects.equals(this.url, other.url)) {
return false;
}
if (!Objects.equals(this.organization, other.organization)) {
return false;
}
if (!Objects.equals(this.description, other.description)) {
return false;
}
if (!Objects.equals(this.homePage, other.homePage)) {
return false;
}
if (!Objects.equals(this.email, other.email)) {
return false;
}
if (this.aggregator != other.aggregator) {
return false;
}
if (this.visible != other.visible) {
return false;
}
if (this.enabled != other.enabled) {
return false;
}
if (!Objects.equals(this.supportedReferences, other.supportedReferences)) {
return false;
}
return true;
}
@Override
public String toString() {
return "BeaconDto{" + "id=" + id + ", name=" + name + ", url=" + url + ", organization=" + organization + ", description=" + description + ", homePage=" + homePage + ", email=" + email + ", aggregator=" + aggregator + ", visible=" + visible + ", enabled=" + enabled + ", supportedReferences=" + supportedReferences + '}';
}
}