public class Person { private Long personId; private String salutation; private String firstName; private String middleName; private String lastName; private String phoneNumber; private String email; private String addressLine1; private String addressLine2; private String city; private String state; private String country; private Calendar birthDate; }
public class Person { private Long personId; private String salutation; private String firstName; private String middleName; private String lastName; private String phoneNumber; private String email; private String addressLine1; private String addressLine2; private String city; private String state; private String country; private Calendar birthDate; public Long getPersonId() { return personId; } public void setPersonId(Long personId) { this.personId = personId; } public String getSalutation() { return salutation; } public void setSalutation(String salutation) { this.salutation = salutation; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getMiddleName() { return middleName; } public void setMiddleName(String middleName) { this.middleName = middleName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getAddressLine1() { return addressLine1; } public void setAddressLine1(String addressLine1) { this.addressLine1 = addressLine1; } public String getAddressLine2() { return addressLine2; } public void setAddressLine2(String addressLine2) { this.addressLine2 = addressLine2; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getState() { return state; } public void setState(String state) { this.state = state; } public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } public Calendar getBirthDate() { return birthDate; } public void setBirthDate(Calendar birthDate) { this.birthDate = birthDate; } @Override public String toString() { return "Person [addressLine1=" + addressLine1 + ", addressLine2=" + addressLine2 + ", birthDate=" + birthDate + ", city=" + city + ", country=" + country + ", email=" + email + ", firstName=" + firstName + ", lastName=" + lastName + ", middleName=" + middleName + ", personId=" + personId + ", phoneNumber=" + phoneNumber + ", salutation=" + salutation + ", state=" + state + "]"; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((addressLine1 == null) ? 0 : addressLine1.hashCode()); result = prime * result + ((addressLine2 == null) ? 0 : addressLine2.hashCode()); result = prime * result + ((birthDate == null) ? 0 : birthDate.hashCode()); result = prime * result + ((city == null) ? 0 : city.hashCode()); result = prime * result + ((country == null) ? 0 : country.hashCode()); result = prime * result + ((email == null) ? 0 : email.hashCode()); result = prime * result + ((firstName == null) ? 0 : firstName.hashCode()); result = prime * result + ((lastName == null) ? 0 : lastName.hashCode()); result = prime * result + ((middleName == null) ? 0 : middleName.hashCode()); result = prime * result + ((personId == null) ? 0 : personId.hashCode()); result = prime * result + ((phoneNumber == null) ? 0 : phoneNumber.hashCode()); result = prime * result + ((salutation == null) ? 0 : salutation.hashCode()); result = prime * result + ((state == null) ? 0 : state.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Person other = (Person) obj; if (addressLine1 == null) { if (other.addressLine1 != null) return false; } else if (!addressLine1.equals(other.addressLine1)) return false; if (addressLine2 == null) { if (other.addressLine2 != null) return false; } else if (!addressLine2.equals(other.addressLine2)) return false; if (birthDate == null) { if (other.birthDate != null) return false; } else if (!birthDate.equals(other.birthDate)) return false; if (city == null) { if (other.city != null) return false; } else if (!city.equals(other.city)) return false; if (country == null) { if (other.country != null) return false; } else if (!country.equals(other.country)) return false; if (email == null) { if (other.email != null) return false; } else if (!email.equals(other.email)) return false; if (firstName == null) { if (other.firstName != null) return false; } else if (!firstName.equals(other.firstName)) return false; if (lastName == null) { if (other.lastName != null) return false; } else if (!lastName.equals(other.lastName)) return false; if (middleName == null) { if (other.middleName != null) return false; } else if (!middleName.equals(other.middleName)) return false; if (personId == null) { if (other.personId != null) return false; } else if (!personId.equals(other.personId)) return false; if (phoneNumber == null) { if (other.phoneNumber != null) return false; } else if (!phoneNumber.equals(other.phoneNumber)) return false; if (salutation == null) { if (other.salutation != null) return false; } else if (!salutation.equals(other.salutation)) return false; if (state == null) { if (other.state != null) return false; } else if (!state.equals(other.state)) return false; return true; } }
@Data public class Person { private Long personId; private String salutation; private String firstName; private String middleName; private String lastName; private String phoneNumber; private String email; private String addressLine1; private String addressLine2; private String city; private String state; private String country; private Calendar birthDate; }
@Cleanup InputStream in = new FileInputStream(args[0]); @Cleanup OutputStream out = new FileOutputStream(args[1]);
@Synchronized public static void hello() { System.out.println("world"); }
@SneakyThrows public void run() { throw new Throwable(); }
Source: https://habr.com/ru/post/72555/
All Articles