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

be.personify.iam.model.vault.Transformer Maven / Gradle / Ivy

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

import java.io.Serializable;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.MapKeyColumn;

import be.personify.util.generator.MetaInfo;
import be.personify.iam.model.ConceptType;
import be.personify.iam.model.util.Concept;

@Entity
@MetaInfo( group="vault", frontendGroup="Entitlement", name="transformer", 
			description="A transformer produces configurable output towards a targetsystem.",
			workflowEnabled=true,
			iconClass="random",
					showInMenu=true,
					sortOrderInGroup = 4,
					number=16,
			isConcept = true,
			afterDeleteGoToLink="provisioningUnit")
public class Transformer extends Concept implements Serializable{
	
	private static final long serialVersionUID = -8394833994690959525L;

	@MetaInfo( searchable=true, showInSearchResultGrid=true, name="name", description = "the name of the transformer", required = true)
	private String name;
	
	@MetaInfo( searchable=true, showInSearchResultGrid=false, name="description", description = "the description of the transformer")
	private String description;
	
	@MetaInfo( searchable=false, showInSearchResultGrid=false, name="className", description = "the classname of the transformer", validationPattern = "^([A-Za-z]{1}[A-Za-z\\d_]*\\.)+[A-Za-z][A-Za-z\\d_]*$", fixedInitialValue = "com.test")
	private String className;
	
	
	@ElementCollection(fetch = FetchType.EAGER)
	@JoinTable(name="transformer_configuration", joinColumns=@JoinColumn(name="id"))
	@MapKeyColumn (name="configuration_id")
	@Column(name="value")
	@MetaInfo( searchable=false, showInSearchResultGrid=false, name="configuration", description = "the configuration of the transformer")
	private Map configuration;
	
	public Transformer() {
		this.setConceptType(ConceptType.Transformer);
	}
	

	public String getName() {
		return name;
	}

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

	public void setDescription(String description) {
		this.description = description;
	}

	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	public Map getConfiguration() {
		return configuration;
	}

	public void setConfiguration(Map configuration) {
		this.configuration = configuration;
	}


	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((className == null) ? 0 : className.hashCode());
		result = prime * result + ((configuration == null) ? 0 : configuration.hashCode());
		result = prime * result + ((description == null) ? 0 : description.hashCode());
		result = prime * result + ((name == null) ? 0 : name.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;
		Transformer other = (Transformer) obj;
		if (className == null) {
			if (other.className != null)
				return false;
		} else if (!className.equals(other.className))
			return false;
		if (configuration == null) {
			if (other.configuration != null)
				return false;
		} else if (!configuration.equals(other.configuration))
			return false;
		if (description == null) {
			if (other.description != null)
				return false;
		} else if (!description.equals(other.description))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}
	
	


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy