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

org.molgenis.data.i18n.model.LanguageFactory Maven / Gradle / Ivy

There is a newer version: 8.4.5
Show newest version
package org.molgenis.data.i18n.model;

import org.molgenis.data.AbstractSystemEntityFactory;
import org.molgenis.data.populate.EntityPopulator;
import org.springframework.stereotype.Component;

@Component
public class LanguageFactory extends AbstractSystemEntityFactory
{
	LanguageFactory(LanguageMetadata languageMetadata, EntityPopulator entityPopulator)
	{
		super(Language.class, languageMetadata, entityPopulator);
	}

	/**
	 * Creates a language with the given code and name
	 *
	 * @param code   language code, e.g. "en"
	 * @param name   language name, e.g. "English"
	 * @param active language active, e.g "true"
	 * @return new language
	 */
	public Language create(String code, String name, boolean active)
	{
		Language language = super.create(code);
		language.setName(name);
		language.setActive(active);
		return language;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy