uk.ac.ebi.ep.ebeye.autocomplete.Suggestion.java Source code

Java tutorial

Introduction

Here is the source code for uk.ac.ebi.ep.ebeye.autocomplete.Suggestion.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package uk.ac.ebi.ep.ebeye.autocomplete;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;

/**
 *
 * @author joseph
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class Suggestion implements Comparable<Suggestion> {

    @JsonProperty("suggestion")
    private String suggestedKeyword;

    public String getSuggestedKeyword() {
        return suggestedKeyword;
    }

    @Override
    public String toString() {
        return suggestedKeyword;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 83 * hash + Objects.hashCode(this.suggestedKeyword);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Suggestion other = (Suggestion) obj;
        return Objects.equals(this.suggestedKeyword, other.suggestedKeyword);
    }

    @Override
    public int compareTo(Suggestion s) {
        return this.suggestedKeyword.compareToIgnoreCase(s.getSuggestedKeyword());
    }

}