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

org.atemsource.atem.utility.transform.impl.builder.TransformationTargetTypeBuilder Maven / Gradle / Ivy

package org.atemsource.atem.utility.transform.impl.builder;

import org.atemsource.atem.api.attribute.CollectionAttribute;
import org.atemsource.atem.api.attribute.CollectionSortType;
import org.atemsource.atem.api.attribute.MapAttribute;
import org.atemsource.atem.api.attribute.relation.SingleAttribute;
import org.atemsource.atem.api.type.EntityType;
import org.atemsource.atem.api.type.EntityTypeBuilder;
import org.atemsource.atem.api.type.PrimitiveType;
import org.atemsource.atem.api.type.Type;


public class TransformationTargetTypeBuilder
{

	private final GenericTransformationBuilder genericTransformationBuilder;

	public TransformationTargetTypeBuilder(GenericTransformationBuilder genericTransformationBuilder)
	{
		this.genericTransformationBuilder = genericTransformationBuilder;
	}

	public  MapAttribute addMapAssociationAttribute(String code, Type keyType, Type valueType)
	{
		MapAttribute attribute =
			getEntityTypeBuilder().addMapAssociationAttribute(code, keyType, valueType, false);
		genericTransformationBuilder.addTargetAttribute(attribute);
		return attribute;
	}

	public  CollectionAttribute addMultiAssociationAttribute(String code, Type targetType,
		CollectionSortType collectionSortType)
	{
		CollectionAttribute attribute =
			getEntityTypeBuilder().addMultiAssociationAttribute(code, targetType, collectionSortType);
		genericTransformationBuilder.addTargetAttribute(attribute);
		return attribute;
	}

	public  SingleAttribute addPrimitiveAttribute(String code, PrimitiveType type)
	{
		SingleAttribute attribute = getEntityTypeBuilder().addPrimitiveAttribute(code, type);
		genericTransformationBuilder.addTargetAttribute(attribute);
		return attribute;
	}

	public  SingleAttribute addSingleAssociationAttribute(String code, EntityType targetType)
	{
		SingleAttribute attribute = getEntityTypeBuilder().addSingleAssociationAttribute(code, targetType);
		genericTransformationBuilder.addTargetAttribute(attribute);
		return attribute;
	}

	public  SingleAttribute addSingleAttribute(String code, Class javaType)
	{
		SingleAttribute attribute = getEntityTypeBuilder().addSingleAttribute(code, javaType);
		genericTransformationBuilder.addTargetAttribute(attribute);
		return attribute;
	}

	public  SingleAttribute addSingleAttribute(String code, Type type)
	{
		SingleAttribute attribute = getEntityTypeBuilder().addSingleAttribute(code, type);
		genericTransformationBuilder.addTargetAttribute(attribute);
		return attribute;
	}

	private EntityTypeBuilder getEntityTypeBuilder()
	{
		return genericTransformationBuilder.getTargetTypeBuilder();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy