com.datahub.authorization.ConjunctivePrivilegeGroup Maven / Gradle / Ivy
Show all versions of datahub-auth-api Show documentation
package com.datahub.authorization;
import java.util.Collection;
/**
* Represents a group of privileges that must ALL be required to authorize a request.
*
* That is, an AND of privileges.
*/
public class ConjunctivePrivilegeGroup {
private final Collection _requiredPrivileges;
public ConjunctivePrivilegeGroup(Collection requiredPrivileges) {
_requiredPrivileges = requiredPrivileges;
}
public Collection getRequiredPrivileges() {
return _requiredPrivileges;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ConjunctivePrivilegeGroup that = (ConjunctivePrivilegeGroup) o;
return _requiredPrivileges.equals(that._requiredPrivileges);
}
@Override
public int hashCode() {
return _requiredPrivileges.hashCode();
}
@Override
public String toString() {
return "ConjunctivePrivilegeGroup{" + "_requiredPrivileges=" + _requiredPrivileges + '}';
}
}