View Javadoc
1   /*
2    *    Copyright 2009-2021 the original author or authors.
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.apache.ibatis.domain.blog;
17  
18  public class PostLite {
19      private PostLiteId theId;
20      private int blogId;
21  
22      public PostLite() {
23      }
24  
25      public PostLite(PostLiteId aId, int aBlogId) {
26          blogId = aBlogId;
27          theId = aId;
28      }
29  
30      public void setId(PostLiteId aId) {
31          theId = aId;
32      }
33  
34      public void setBlogId(int aBlogId) {
35          blogId = aBlogId;
36      }
37  
38      public PostLiteId getId() {
39          return theId;
40      }
41  
42      public int getBlogId() {
43          return blogId;
44      }
45  
46      @Override
47      public boolean equals(Object o) {
48          if (this == o) {
49              return true;
50          }
51          if (o == null || getClass() != o.getClass()) {
52              return false;
53          }
54  
55          final PostLite that = (PostLite) o;
56  
57          if (blogId != that.blogId) {
58              return false;
59          }
60          if (theId != null ? !theId.equals(that.theId) : that.theId != null) {
61              return false;
62          }
63  
64          return true;
65      }
66  
67      @Override
68      public int hashCode() {
69          int myresult = theId != null ? theId.hashCode() : 0;
70          myresult = 31 * myresult + blogId;
71          return myresult;
72      }
73  }