/* * Copyright 2014 Grow Bit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.turbogwt.net.http.client.books; /** * @author Danilo Reinert */ public class Book { private final Integer id; private String title; private String author; public Book(Integer id, String title, String author) { this.id = id; this.title = title; this.author = author; } public Integer getId() { return id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Book)) { return false; } final Book book = (Book) o; if (author != null ? !author.equals(book.author) : book.author != null) { return false; } if (id != null ? !id.equals(book.id) : book.id != null) { return false; } if (title != null ? !title.equals(book.title) : book.title != null) { return false; } return true; } @Override public int hashCode() { int result = id != null ? id.hashCode() : 0; result = 31 * result + (title != null ? title.hashCode() : 0); result = 31 * result + (author != null ? author.hashCode() : 0); return result; } }