org.molgenis.data.EntityFactory Maven / Gradle / Ivy
package org.molgenis.data;
/**
* Entity factory that creates {@link Entity} instances.
*
* @param entity type
* @param entity id type
*/
public interface EntityFactory {
/**
* Returns entity type id
*
* @return entity type id
*/
String getEntityTypeId();
/**
* Creates an entity.
*
* @return new entity
*/
E create();
/**
* Creates an entity with the given id.
*
* @param entityId entity id
* @return new entity with id
*/
E create(P entityId);
/**
* Creates an entity based on the given untyped entity.
*
* @param entity untyped entity
* @return typed entity
*/
E create(Entity entity);
}