Skip to content

Commit

Permalink
Adding equals and hashcode impl for access (#17643)
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptoe authored Jan 20, 2025
1 parent 62a53ab commit 93fac4d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions server/src/main/java/org/apache/druid/server/security/Access.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.apache.druid.query.policy.Policy;

import javax.annotation.Nullable;
import java.util.Objects;
import java.util.Optional;

/**
Expand Down Expand Up @@ -136,4 +137,24 @@ public String toString()
return StringUtils.format("Allowed:%s, Message:%s, Policy: %s", allowed, message, policy);
}

@Override
public boolean equals(Object o)
{
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Access access = (Access) o;
return allowed == access.allowed
&& Objects.equals(message, access.message)
&& Objects.equals(policy, access.policy);
}

@Override
public int hashCode()
{
return Objects.hash(allowed, message, policy);
}
}

0 comments on commit 93fac4d

Please sign in to comment.