package com.webratio.webapp;

public class Book implements java.io.Serializable {
    /** Serial version identifier. */
    private static final long serialVersionUID = 1L;

    private java.lang.Integer _oid;

    private java.lang.String _author;

    private java.lang.String _title;

    private java.lang.String _state;

    private java.lang.String _description;

    private java.lang.String _plot;

    private java.lang.String _publisher;

    private java.lang.Integer _year;

    private java.lang.Integer _price;

    private java.util.Set _bookToUser = new java.util.HashSet();

    private float _searchScore;

    public java.lang.Integer getOid() {
        return _oid;
    }

    public void setOid(java.lang.Integer _oid) {
        this._oid = _oid;
    }

    public java.lang.String getAuthor() {
        return _author;
    }

    public void setAuthor(java.lang.String _author) {
        this._author = _author;
    }

    public java.lang.String getTitle() {
        return _title;
    }

    public void setTitle(java.lang.String _title) {
        this._title = _title;
    }

    public java.lang.String getState() {
        return _state;
    }

    public void setState(java.lang.String _state) {
        this._state = _state;
    }

    public java.lang.String getDescription() {
        return _description;
    }

    public void setDescription(java.lang.String _description) {
        this._description = _description;
    }

    public java.lang.String getPlot() {
        return _plot;
    }

    public void setPlot(java.lang.String _plot) {
        this._plot = _plot;
    }

    public java.lang.String getPublisher() {
        return _publisher;
    }

    public void setPublisher(java.lang.String _publisher) {
        this._publisher = _publisher;
    }

    public java.lang.Integer getYear() {
        return _year;
    }

    public void setYear(java.lang.Integer _year) {
        this._year = _year;
    }

    public java.lang.Integer getPrice() {
        return _price;
    }

    public void setPrice(java.lang.Integer _price) {
        this._price = _price;
    }

    public java.util.Set getBookToUser() {
        return _bookToUser;
    }

    public void setBookToUser(java.util.Set _bookToUser) {
        this._bookToUser = _bookToUser;
    }

    public float getSearchScore() {
        return _searchScore;
    }

    public void setSearchScore(float _searchScore) {
        this._searchScore = _searchScore;
    }

    public String toString() {
        java.lang.StringBuffer sb = new java.lang.StringBuffer();
        sb.append(super.toString());
        int n = sb.length() - 1;
        if (sb.charAt(n) == ']') {
            sb.setCharAt(n, ',');
        } else {
            sb.append('[');
        }
        if (_oid != null)
            sb.append("oid=" + _oid + ',');
        if (_author != null)
            sb.append("author=" + _author + ',');
        if (_title != null)
            sb.append("title=" + _title + ',');
        if (_state != null)
            sb.append("state=" + _state + ',');
        if (_description != null)
            sb.append("description=" + _description + ',');
        if (_plot != null)
            sb.append("plot=" + _plot + ',');
        if (_publisher != null)
            sb.append("publisher=" + _publisher + ',');
        if (_year != null)
            sb.append("year=" + _year + ',');
        if (_price != null)
            sb.append("price=" + _price + ',');
        n = sb.length() - 1;
        if (sb.charAt(n) == ',') {
            sb.setCharAt(n, ']');
        } else if (sb.charAt(n) == '[') {
            sb.deleteCharAt(n);
        }
        return sb.toString();
    }

    public boolean equals(java.lang.Object obj) {
        if (!(obj instanceof Book)) {
            return false;
        }
        Book otherBook = (Book) obj;
        java.lang.Object key = null;
        java.lang.Object otherKey = null;
        key = this.getOid();
        otherKey = otherBook.getOid();
        if (key == null) {
            if (otherKey != null) {
                return false;
            }
        } else {
            if (otherKey == null) {
                return false;
            } else if (!key.equals(otherKey)) {
                return false;
            }
        }
        return true;
    }

    public int hashCode() {
        int hashCode = 0;
        java.lang.Object key = null;
        key = this.getOid();
        if (key != null) {
            hashCode |= key.hashCode();
        }
        return hashCode;
    }
}
