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

be.personify.iam.model.authentication.Policy Maven / Gradle / Ivy

There is a newer version: 1.5.2.RELEASE
Show newest version
package be.personify.iam.model.authentication;

import java.io.Serializable;
import java.util.List;

import be.personify.util.Decision;
import be.personify.util.generator.MetaInfo;

@MetaInfo( name="Policy", group="authentication", frontendGroup = "Authorization", 
	description="A calulated policy", iconClass = "ban", number=5, showInMenu = true)
public class Policy implements Serializable{
	
	private static final long serialVersionUID = -2230200389392418855L;

	@MetaInfo(name="the permission", description="the permission linked to this policy : see permission_", searchable = false)
	private Permission permission;

	@MetaInfo(name="the decision", description="the decision linked to this policy : ALLOW, DENY")
	private Decision decision;
	
	@MetaInfo(name="the policyConditions", description="the policyConditions linked to this policy : see policyCondition_")
	private List policyConditions;



	public Permission getPermission() {
		return permission;
	}

	public void setPermission(Permission permission) {
		this.permission = permission;
	}

	public Decision getDecision() {
		return decision;
	}

	public void setDecision(Decision decision) {
		this.decision = decision;
	}

	public List getPolicyConditions() {
		return policyConditions;
	}

	public void setPolicyConditions(List policyConditions) {
		this.policyConditions = policyConditions;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((decision == null) ? 0 : decision.hashCode());
		result = prime * result + ((permission == null) ? 0 : permission.hashCode());
		result = prime * result + ((policyConditions == null) ? 0 : policyConditions.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		Policy other = (Policy) obj;
		if (decision != other.decision)
			return false;
		if (permission == null) {
			if (other.permission != null)
				return false;
		} else if (!permission.equals(other.permission))
			return false;
		if (policyConditions == null) {
			if (other.policyConditions != null)
				return false;
		} else if (!policyConditions.equals(other.policyConditions))
			return false;
		return true;
	}
	
	
	
	

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy