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

org.esfinge.guardian.rbac.entity.Role Maven / Gradle / Ivy

There is a newer version: 1.2.3
Show newest version
package org.esfinge.guardian.rbac.entity;

public class Role {
	private String roleName;
	
	public Role(String roleName) {
		this.roleName = roleName;
	}
	
	@Override
	final public String toString() {
		return roleName;
	}
	
	@Override
	final public boolean equals(Object o) {
		if (o != null && roleName != null && o instanceof Role) {
			return roleName.equals(((Role) o).getRoleName());
		}
		return false;
	}
	
	@Override
	final public int hashCode() {
		return roleName.toLowerCase().hashCode();
	}
	
	final public String getRoleName() {
		return roleName;
	}
	
	public boolean isSubjectInRole(Role role) {
		return this.equals(role);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy