Skip to content
Permalink
Browse files
equals/hashcode/toString for AnubisPrincipal.
  • Loading branch information
mifosio-04-04-2018 committed May 29, 2017
1 parent c6e6ba2 commit 1b46e5671b530e7190d069337b83ee36495a9496
Showing 1 changed file with 24 additions and 0 deletions.
@@ -15,6 +15,8 @@
*/
package io.mifos.anubis.security;

import java.util.Objects;

/**
* @author Myrle Krantz
*/
@@ -35,4 +37,26 @@ public String getUser() {
public String getForApplicationName() {
return forApplicationName;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AnubisPrincipal that = (AnubisPrincipal) o;
return Objects.equals(user, that.user) &&
Objects.equals(forApplicationName, that.forApplicationName);
}

@Override
public int hashCode() {
return Objects.hash(user, forApplicationName);
}

@Override
public String toString() {
return "AnubisPrincipal{" +
"user='" + user + '\'' +
", forApplicationName='" + forApplicationName + '\'' +
'}';
}
}

0 comments on commit 1b46e56

Please sign in to comment.