/** * Generate a new entity with the given type and a new id * @param type */ public Entity(String type){ this(new SimpleId( type )); }
private MvccEntity getEntity( final String type ) { final SimpleId entityId = new SimpleId( type ); final UUID version = UUIDGenerator.newTimeUUID(); final Entity entity = new Entity( entityId ); MvccEntityImpl logEntry = new MvccEntityImpl( entityId, version, MvccEntity.Status.COMPLETE, entity ); return logEntry; }
/** * Create a row key with the node id in the row key, the edge type, and the type from the typeid * * @param nodeId The node id in the row key * @param edgeType The type of the edge * @param typeId The type of hte id */ public RowKeyType( final Id nodeId, final String edgeType, final Id typeId, final long shardId ) { this( nodeId, edgeType, typeId.getType(), shardId ); }
public boolean hasVersion(){ return getVersion() != null; }
/** * Generate an entity based on the map * @param map */ public static Entity fromMap(EntityMap map){ return map != null ? mapToEntityConverter.fromMap(map,true) : null; }
/** * Convert Entity to Map, adding version_ug_field and a {name}_ug_analyzed field for each * StringField. */ public static Map toMap(EntityObject entity) { return entityConverter.toMap(entity); }
/** * Generate an entity Id from the given UUID * * @param entityId the entity's UUID */ public static Id generateEntityId( UUID entityId, String entityType ) { return new SimpleId( entityId, entityType ); }
public static EntityMap fromEntity(Entity entity) { EntityMap map = entityToMapConverter.toMap(entity); return map; }
@Override public Id asId() { return new SimpleId(id, CONNECTION_ENTITY_TYPE ); }
@Override public Id asId() { return new SimpleId( id, type ); }
@Override public Id asId() { return new SimpleId( id, "role" ); }
@Override public Id asId() { return new SimpleId( uuid, type ); }
@Override public Id asId() { return new SimpleId(uuid, type); }
private Id getAppIdObject(){ return new SimpleId( applicationId, TYPE_APPLICATION ); }
private static Id getAppIdObject(UUID applicationId){ return new SimpleId( applicationId, TYPE_APPLICATION ); }
/** * Generate an ID with the type and id * * @param id The uuid in the id * @param type The type of id */ public static Id createId( UUID id, String type ) { return new SimpleId( id, type ); } }