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

browserl.ist.Browser Maven / Gradle / Ivy

The newest version!
package browserl.ist;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author Kent Yeh
 */
public class Browser implements Serializable {

    private static final long serialVersionUID = -1303804222663298256L;

    private String code;
    private String browser;
    private String abbr;
    private String prefix;
    private String type;
    private double usageGlobal;
    private String version;

    public Browser(String code, String browser, String abbr, String prefix, String type, Number usageGlobal, String version) {
        this.code = code;
        this.browser = browser;
        this.abbr = abbr;
        this.prefix = prefix;
        this.type = type;
        this.usageGlobal = usageGlobal.doubleValue();
        this.version = version;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getBrowser() {
        return browser;
    }

    public void setBrowser(String browser) {
        this.browser = browser;
    }

    public String getAbbr() {
        return abbr;
    }

    public void setAbbr(String abbr) {
        this.abbr = abbr;
    }

    public String getPrefix() {
        return prefix;
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }

    /**
     * Css prefix for this browser.
     *
     * @return prefix of browser
     */
    public String getType() {
        return type;
    }

    /**
     * Type of browser,
     *
     * @param type "desktop" or "mobile"
     */
    public void setType(String type) {
        this.type = type;
    }

    /**
     * Browser global usage ratio.
     *
     * @return global usage ratio of browser.
     */
    public double getUsageGlobal() {
        return usageGlobal;
    }

    public void setUsageGlobal(double usageGlobal) {
        this.usageGlobal = usageGlobal;
    }

    /**
     * version for browser. maybe 45 or 9.5-9.6 ...
     *
     * @return version of browser.
     */
    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 79 * hash + Objects.hashCode(this.code);
        hash = 79 * hash + Objects.hashCode(this.version);
        return hash;
    }

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

    @Override
    public String toString() {
        return this.browser + " " + this.version;

    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy