be.personify.iam.model.vault.EntitlementConflict Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of personify-model Show documentation
Show all versions of personify-model Show documentation
a possible model for personify
package be.personify.iam.model.vault;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.OneToOne;
import be.personify.util.generator.MetaInfo;
import be.personify.iam.model.ConceptType;
import be.personify.iam.model.util.Concept;
@Entity
@MetaInfo( group="vault", frontendGroup="Governance", name="Entitlement conflict",
description="entitlements that should not be combined", iconClass = "medkit",
workflowEnabled=true,
showInMenu = true,
isConcept=true,
number=39)
public class EntitlementConflict extends Concept implements Serializable {
private static final long serialVersionUID = -9118053306446324489L;
@OneToOne
@MetaInfo(name="firstEntitlement", description="the second entitlement of the conflict: see entitlement_", required = true, editable = false)
private Entitlement firstEntitlement;
@OneToOne
@MetaInfo(name="secondEntitlement", description="the second entitlement of the conflict: see entitlement_", required = true, editable = false)
private Entitlement secondEntitlement;
@MetaInfo(name="crossOrganisation", description="is the conflict crossing organisations")
private boolean crossOrganisation;
@MetaInfo( showInSearchResultGrid=false,
name="description",
description="the description of the entitlement conflict",
required = false,
searchable = false,
customRenderer = "text_area|rows:3")
private String description;
@Enumerated
@MetaInfo( name="conflictCorrection", description = "conflict correciton action : to be taken for resolving the conflict",
showInSearchResultGrid = false, searchable = false)
private ConflictCorrection conflictCorrection;
/**
* Constructor
*/
public EntitlementConflict() {
this.conceptType = ConceptType.EntitlementConflict;
}
public Entitlement getFirstEntitlement() {
return firstEntitlement;
}
public void setFirstEntitlement(Entitlement firstEntitlement) {
this.firstEntitlement = firstEntitlement;
}
public Entitlement getSecondEntitlement() {
return secondEntitlement;
}
public void setSecondEntitlement(Entitlement secondEntitlement) {
this.secondEntitlement = secondEntitlement;
}
public boolean isCrossOrganisation() {
return crossOrganisation;
}
public void setCrossOrganisation(boolean crossOrganisation) {
this.crossOrganisation = crossOrganisation;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public ConflictCorrection getConflictCorrection() {
return conflictCorrection;
}
public void setConflictCorrection(ConflictCorrection conflictCorrection) {
this.conflictCorrection = conflictCorrection;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((conflictCorrection == null) ? 0 : conflictCorrection.hashCode());
result = prime * result + (crossOrganisation ? 1231 : 1237);
result = prime * result + ((description == null) ? 0 : description.hashCode());
result = prime * result + ((firstEntitlement == null) ? 0 : firstEntitlement.hashCode());
result = prime * result + ((secondEntitlement == null) ? 0 : secondEntitlement.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;
EntitlementConflict other = (EntitlementConflict) obj;
if (conflictCorrection != other.conflictCorrection)
return false;
if (crossOrganisation != other.crossOrganisation)
return false;
if (description == null) {
if (other.description != null)
return false;
} else if (!description.equals(other.description))
return false;
if (firstEntitlement == null) {
if (other.firstEntitlement != null)
return false;
} else if (!firstEntitlement.equals(other.firstEntitlement))
return false;
if (secondEntitlement == null) {
if (other.secondEntitlement != null)
return false;
} else if (!secondEntitlement.equals(other.secondEntitlement))
return false;
return true;
}
}