All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.graylog2.restclient.models.Startpage Maven / Gradle / Ivy

The newest version!
/**
 * This file is part of Graylog.
 *
 * Graylog is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Graylog is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Graylog.  If not, see .
 */
package org.graylog2.restclient.models;

/**
 * @author Lennart Koopmann 
 */
public class Startpage {

    public enum Type {
        STREAM("Stream"),
        DASHBOARD("Dashboard");

        private final String description;

        Type(String description) {
            this.description = description;
        }

        public String getDescription() {
            return description;
        }
    }

    private final Type type;
    private final String id;

    public Startpage(Type type, String id) {
        this.type = type;
        this.id = id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Startpage startpage = (Startpage) o;

        if (id != null ? !id.equals(startpage.id) : startpage.id != null) return false;
        if (type != startpage.type) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = type != null ? type.hashCode() : 0;
        result = 31 * result + (id != null ? id.hashCode() : 0);
        return result;
    }

    public Type getType() {
        return type;
    }

    public String getId() {
        return id;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy