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

be.personify.iam.model.provisioning.TargetSystemAttribute Maven / Gradle / Ivy

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

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

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

import com.fasterxml.jackson.annotation.JsonIgnore;

import be.personify.iam.model.util.Persisted;
import be.personify.util.AttributeType;
import be.personify.util.generator.MetaInfo;

@Entity
@MetaInfo( group="provisioning", frontendGroup="TargetSystem", name="Targetsystem attribute", description="A TargetSystemAttribute",
	iconClass = "location-arrow",
	afterDeleteGoToLink="targetSystem",
	afterCreateGoToLink="targetSystem",
	afterUpdateGoToLink = "targetSystem",
	showInMenu=false,
	number = 2,
	sortOrderInGroup=2,
	rst_include_description = true,
	showOnHomePage=false
)
public class TargetSystemAttribute extends Persisted implements Serializable {

	private static final long serialVersionUID = -5660173065659749002L;

		
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@MetaInfo(name="id", description="the id of the targetsystem attribute", searchable=false,showInSearchResultGrid=false)
	private long id;
	
	@MetaInfo(name="name", description="the name of the remove native attribute in the targetsystem_", editable = false)
	private String name;
	
	@ManyToOne( targetEntity=TargetSystem.class)
	@MetaInfo( showInSearchResultGrid=false, name="targetsystem", description="the link to the targetsystem_", searchable = false, editable = false)
	@JsonIgnore
	private TargetSystem targetSystem; 
	
	@Enumerated(EnumType.STRING)
	@MetaInfo(name="Attribute type", description="The type of attribute : STRING,INTEGER,BOOLEAN,DATETIME,PASSWORD")
	private AttributeType attributeType;
	
	@MetaInfo(searchable=false, showInSearchResultGrid=false, name="readable", description="determines if the attribute is readable")
	private boolean readable;
	
	@MetaInfo(searchable=false, showInSearchResultGrid=false, name="writable", description="determines if the attribute is writable")
	private boolean writable;
	
	@MetaInfo(searchable=false, showInSearchResultGrid=false, name="indexed", description="determines if the attribute is indexed")
	private boolean indexed;
	
	@MetaInfo(searchable=false, showInSearchResultGrid=false, name="unique", description="specifies if this attribute is unique in this targetsystem")
	@Column(name = "_unique")
	private boolean unique;
	
	@MetaInfo(name="multiValued", description="determines if the attribute can contain multiple values", showInSearchResultGridMobile = false)
	private boolean multiValued;
	
	@MetaInfo(name="primaryKey", description="specifies if this attribute is the primary key for this targetsystem", showInSearchResultGridMobile = false)
	private boolean primaryKey;
	
	
	
	
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public AttributeType getAttributeType() {
		return attributeType;
	}

	public void setAttributeType(AttributeType attributeType) {
		this.attributeType = attributeType;
	}

	public boolean isReadable() {
		return readable;
	}

	public void setReadable(boolean readable) {
		this.readable = readable;
	}

	public boolean isWritable() {
		return writable;
	}

	public void setWritable(boolean writable) {
		this.writable = writable;
	}

	public boolean isMultiValued() {
		return multiValued;
	}

	public void setMultiValued(boolean multiValued) {
		this.multiValued = multiValued;
	}


	public boolean isPrimaryKey() {
		return primaryKey;
	}

	public void setPrimaryKey(boolean primaryKey) {
		this.primaryKey = primaryKey;
	}

	public TargetSystem getTargetSystem() {
		return targetSystem;
	}

	public void setTargetSystem(TargetSystem targetSystem) {
		this.targetSystem = targetSystem;
	}
	
	
	public boolean isIndexed() {
		return indexed;
	}

	public void setIndexed(boolean indexed) {
		this.indexed = indexed;
	}
	
	
	public boolean isUnique() {
		return unique;
	}

	public void setUnique(boolean unique) {
		this.unique = unique;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((attributeType == null) ? 0 : attributeType.hashCode());
		result = prime * result + (int) (id ^ (id >>> 32));
		result = prime * result + (indexed ? 1231 : 1237);
		result = prime * result + (multiValued ? 1231 : 1237);
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + (primaryKey ? 1231 : 1237);
		result = prime * result + (readable ? 1231 : 1237);
		result = prime * result + ((targetSystem == null) ? 0 : targetSystem.hashCode());
		result = prime * result + (unique ? 1231 : 1237);
		result = prime * result + (writable ? 1231 : 1237);
		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;
		TargetSystemAttribute other = (TargetSystemAttribute) obj;
		if (attributeType != other.attributeType)
			return false;
		if (id != other.id)
			return false;
		if (indexed != other.indexed)
			return false;
		if (multiValued != other.multiValued)
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (primaryKey != other.primaryKey)
			return false;
		if (readable != other.readable)
			return false;
		if (targetSystem == null) {
			if (other.targetSystem != null)
				return false;
		} else if (!targetSystem.equals(other.targetSystem))
			return false;
		if (unique != other.unique)
			return false;
		if (writable != other.writable)
			return false;
		return true;
	}

	
	

	
	public be.personify.util.provisioning.TargetSystemAttribute toGeneric() {
		be.personify.util.provisioning.TargetSystemAttribute generic = new be.personify.util.provisioning.TargetSystemAttribute();
		generic.setAttributeType(attributeType);
		generic.setId(id);
		generic.setIndexed(indexed);
		generic.setMultiValued(multiValued);
		generic.setName(name);
		generic.setPrimaryKey(primaryKey);
		generic.setReadable(readable);
		generic.setUnique(unique);
		generic.setWritable(writable);
		return generic;
	}

	
	public static List toGenericList(	List targetSystemAttributes) {
		List genericList = new ArrayList();
		for ( TargetSystemAttribute ta : targetSystemAttributes) {
			genericList.add(ta.toGeneric());
		}
		return genericList;
	}
	
	
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy