/*
* 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 javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Query DTO.
*
* @author Miroslav Cupak (mirocupak@gmail.com)
* @version 1.0
*/
@XmlRootElement(name = "query")
@XmlType(name = "query")
public class QueryDto implements Serializable {
private static final long serialVersionUID = 3L;
private ChromosomeDto chromosome;
private Long position;
private String allele;
private ReferenceDto reference;
public QueryDto() {
// needed for JAXB
}
public QueryDto(ChromosomeDto chromosome, Long position, String allele, ReferenceDto reference) {
this.chromosome = chromosome;
this.position = position;
this.allele = allele;
this.reference = reference;
}
public ChromosomeDto getChromosome() {
return chromosome;
}
public void setChromosome(ChromosomeDto chromosome) {
this.chromosome = chromosome;
}
public Long getPosition() {
return position;
}
public void setPosition(Long position) {
this.position = position;
}
public String getAllele() {
return allele;
}
public void setAllele(String allele) {
this.allele = allele;
}
public ReferenceDto getReference() {
return reference;
}
public void setReference(ReferenceDto reference) {
this.reference = reference;
}
@Override
public int hashCode() {
int hash = 3;
hash = 89 * hash + Objects.hashCode(this.chromosome);
hash = 89 * hash + Objects.hashCode(this.position);
hash = 89 * hash + Objects.hashCode(this.allele);
hash = 89 * hash + Objects.hashCode(this.reference);
return hash;
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final QueryDto other = (QueryDto) obj;
if (this.chromosome != other.chromosome) {
return false;
}
if (!Objects.equals(this.position, other.position)) {
return false;
}
if (!Objects.equals(this.allele, other.allele)) {
return false;
}
if (this.reference != other.reference) {
return false;
}
return true;
}
@Override
public String toString() {
return "Query{" + "chromosome=" + chromosome + ", position=" + position + ", allele=" + allele + ", reference=" + reference + '}';
}
}