Last active
August 29, 2015 14:12
-
-
Save ivanursul/daf4ad2580eed421fb7f to your computer and use it in GitHub Desktop.
Simple POJO for ivanursul.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.ivanursul.spark.dto; | |
| public class Person { | |
| private Long id; | |
| private String name; | |
| private Integer age; | |
| public Long getId() { | |
| return id; | |
| } | |
| public void setId(final Long id) { | |
| this.id = id; | |
| } | |
| public String getName() { | |
| return name; | |
| } | |
| public void setName(final String name) { | |
| this.name = name; | |
| } | |
| public Integer getAge() { | |
| return age; | |
| } | |
| public void setAge(final Integer age) { | |
| this.age = age; | |
| } | |
| @Override | |
| public int hashCode() { | |
| final int prime = 31; | |
| int result = 1; | |
| result = prime * result + ((age == null) ? 0 : age.hashCode()); | |
| result = prime * result + ((name == null) ? 0 : name.hashCode()); | |
| return result; | |
| } | |
| @Override | |
| public boolean equals(final Object obj) { | |
| if (this == obj) { | |
| return true; | |
| } | |
| if (obj == null) { | |
| return false; | |
| } | |
| if (getClass() != obj.getClass()) { | |
| return false; | |
| } | |
| Person other = (Person) obj; | |
| if (age == null) { | |
| if (other.age != null) { | |
| return false; | |
| } | |
| } else if (!age.equals(other.age)) { | |
| return false; | |
| } | |
| if (name == null) { | |
| if (other.name != null) { | |
| return false; | |
| } | |
| } else if (!name.equals(other.name)) { | |
| return false; | |
| } | |
| return true; | |
| } | |
| @Override | |
| public String toString() { | |
| return "Person [name=" + name + ", age=" + age + "]"; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment