applied formatter

This commit is contained in:
Venkata Kiran Surapaneni 2019-01-28 01:55:39 -05:00
parent 474a3675f1
commit 435f198298
1 changed files with 51 additions and 52 deletions

View File

@ -3,69 +3,68 @@ package com.baeldung.jdbc;
import java.util.Objects; import java.util.Objects;
public class Employee { public class Employee {
private int id; private int id;
private String name; private String name;
private String position; private String position;
private double salary; private double salary;
public Employee() { public Employee() {
} }
public Employee(int id, String name, double salary, String position) { public Employee(int id, String name, double salary, String position) {
this.id = id; this.id = id;
this.name = name; this.name = name;
this.salary = salary; this.salary = salary;
this.position = position; this.position = position;
} }
public int getId() { public int getId() {
return id; return id;
} }
public void setId(int id) { public void setId(int id) {
this.id = id; this.id = id;
} }
public String getName() { public String getName() {
return name; return name;
} }
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public double getSalary() { public double getSalary() {
return salary; return salary;
} }
public void setSalary(double salary) { public void setSalary(double salary) {
this.salary = salary; this.salary = salary;
} }
public String getPosition() { public String getPosition() {
return position; return position;
} }
public void setPosition(String position) { public void setPosition(String position) {
this.position = position; this.position = position;
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(id, name, position, salary); return Objects.hash(id, name, position, salary);
} }
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (this == obj) if (this == obj)
return true; return true;
if (obj == null) if (obj == null)
return false; return false;
if (getClass() != obj.getClass()) if (getClass() != obj.getClass())
return false; return false;
Employee other = (Employee) obj; Employee other = (Employee) obj;
return id == other.id && Objects.equals(name, other.name) && Objects.equals(position, other.position) return id == other.id && Objects.equals(name, other.name) && Objects.equals(position, other.position) && Double.doubleToLongBits(salary) == Double.doubleToLongBits(other.salary);
&& Double.doubleToLongBits(salary) == Double.doubleToLongBits(other.salary); }
}
} }