dnet-hadoop/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/common/EntityType.java

22 lines
598 B
Java
Raw Normal View History

2020-04-30 11:05:17 +02:00
package eu.dnetlib.dhp.schema.common;
import eu.dnetlib.dhp.schema.oaf.OafEntity;
/** Actual entity types in the Graph */
public enum EntityType {
2020-04-30 11:05:17 +02:00
publication, dataset, otherresearchproduct, software, datasource, organization, project;
2020-04-30 11:05:17 +02:00
/**
* Resolves the EntityType, given the relative class name
*
* @param clazz the given class name
* @param <T> actual OafEntity subclass
* @return the EntityType associated to the given class
*/
public static <T extends OafEntity> EntityType fromClass(Class<T> clazz) {
2020-04-30 11:05:17 +02:00
return EntityType.valueOf(clazz.getSimpleName().toLowerCase());
}
}