All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.clouway.oauth2.user.User Maven / Gradle / Ivy

package com.clouway.oauth2.user;

/**
 * @author Mihail Lesikov ([email protected])
 */
public class User {
  public final String id;
  public final String email;
  public final String name;

  public User(String id,String email, String name) {
    this.id = id;
    this.email = email;
    this.name = name;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (!(o instanceof User)) return false;

    User user = (User) o;

    if (email != null ? !email.equals(user.email) : user.email != null) return false;
    if (id != null ? !id.equals(user.id) : user.id != null) return false;
    if (name != null ? !name.equals(user.name) : user.name != null) return false;

    return true;
  }

  @Override
  public int hashCode() {
    int result = id != null ? id.hashCode() : 0;
    result = 31 * result + (email != null ? email.hashCode() : 0);
    result = 31 * result + (name != null ? name.hashCode() : 0);
    return result;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy