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

com.foreach.across.modules.entity.converters.StringToEntityConfigurationConverter Maven / Gradle / Ivy

There is a newer version: 4.5.1
Show newest version
package com.foreach.across.modules.entity.converters;

import com.foreach.across.modules.entity.registry.EntityConfiguration;
import com.foreach.across.modules.entity.registry.EntityRegistry;
import org.springframework.core.convert.converter.Converter;

/**
 * Converts a string to an EntityConfiguration by interpreting the string as the name of
 * the EntityConfiguration.
 */
public class StringToEntityConfigurationConverter implements Converter
{
	private final EntityRegistry entityRegistry;

	public StringToEntityConfigurationConverter( EntityRegistry entityRegistry ) {
		this.entityRegistry = entityRegistry;
	}

	@Override
	public EntityConfiguration convert( String entityName ) {
		return entityRegistry.getEntityConfiguration( entityName );
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy