Subversion Repositories Integrator Subversion

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 espaco 1
/*
2
 * Copyright 2009-2014 PrimeTek.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 * http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package org.primefaces.ultima.domain;
17
 
18
import java.io.Serializable;
19
 
20
public class Book implements Serializable {
21
 
22
    private String title;
23
        private String author;
24
        private String publisher;
25
        private Integer pages;
26
 
27
        public String getTitle() {
28
                return title;
29
        }
30
 
31
        public void setTitle(String title) {
32
                this.title = title;
33
        }
34
 
35
        public String getAuthor() {
36
                return author;
37
        }
38
 
39
        public void setAuthor(String author) {
40
                this.author = author;
41
        }
42
 
43
        public String getPublisher() {
44
                return publisher;
45
        }
46
 
47
        public void setPublisher(String publisher) {
48
                this.publisher = publisher;
49
        }
50
 
51
        public Integer getPages() {
52
                return pages;
53
        }
54
 
55
        public void setPages(Integer pages) {
56
                this.pages = pages;
57
        }
58
 
59
        public boolean equals(Object obj) {
60
                if(!(obj instanceof Book))
61
                        return false;
62
 
63
                Book book = (Book) obj;
64
 
65
                return (book.getTitle() != null && book.getTitle().equals(title)) && (book.getAuthor() != null && book.getAuthor().equals(author));
66
        }
67
 
68
        public int hashCode() {
69
                int hash = 1;
70
                if(title != null)
71
                        hash = hash * 31 + title.hashCode();
72
 
73
                if(author != null)
74
                        hash = hash * 29 + author.hashCode();
75
 
76
                return hash;
77
        }
78
}