64 lines
1.6 KiB
Java
64 lines
1.6 KiB
Java
/**
|
|
*
|
|
*/
|
|
package org.gcube.informationsystem.resourceregistry.er;
|
|
|
|
import org.gcube.informationsystem.model.embedded.Embedded;
|
|
import org.gcube.informationsystem.model.entity.Context;
|
|
import org.gcube.informationsystem.model.entity.Entity;
|
|
import org.gcube.informationsystem.model.entity.Facet;
|
|
import org.gcube.informationsystem.model.entity.Resource;
|
|
import org.gcube.informationsystem.model.relation.ConsistsOf;
|
|
import org.gcube.informationsystem.model.relation.IsParentOf;
|
|
import org.gcube.informationsystem.model.relation.IsRelatedTo;
|
|
import org.gcube.informationsystem.model.relation.Relation;
|
|
|
|
/**
|
|
* @author Luca Frosini (ISTI - CNR)
|
|
*
|
|
* Enumerates the basic type names.
|
|
*/
|
|
public enum AccessType {
|
|
|
|
EMBEDDED(Embedded.class, Embedded.NAME),
|
|
CONTEXT(Context.class, Context.NAME),
|
|
IS_PARENT_OF(IsParentOf.class, IsParentOf.NAME),
|
|
|
|
ENTITY(Entity.class, Entity.NAME),
|
|
RESOURCE(Resource.class, Resource.NAME),
|
|
FACET(Facet.class, Facet.NAME),
|
|
|
|
RELATION(Relation.class, Relation.NAME),
|
|
IS_RELATED_TO(IsRelatedTo.class, IsRelatedTo.NAME),
|
|
CONSISTS_OF(ConsistsOf.class, ConsistsOf.NAME);
|
|
|
|
|
|
private final Class<?> clz;
|
|
private final String name;
|
|
private final String lowerCaseFirstCharacter;
|
|
|
|
AccessType(Class<?> clz, String name){
|
|
this.clz = clz;
|
|
this.name = name;
|
|
this.lowerCaseFirstCharacter = name.substring(0, 1).toLowerCase() + name.substring(1);
|
|
}
|
|
|
|
public String lowerCaseFirstCharacter() {
|
|
return lowerCaseFirstCharacter;
|
|
}
|
|
|
|
public Class<?> getTypeClass(){
|
|
return clz;
|
|
}
|
|
|
|
public String getName(){
|
|
return name;
|
|
}
|
|
|
|
@Override
|
|
public String toString(){
|
|
return name;
|
|
}
|
|
|
|
}
|