当前位置: 首页>>代码示例>>Java>>正文


Java ExceptionFactory.vertexIdCanNotBeNull方法代码示例

本文整理汇总了Java中com.tinkerpop.blueprints.util.ExceptionFactory.vertexIdCanNotBeNull方法的典型用法代码示例。如果您正苦于以下问题:Java ExceptionFactory.vertexIdCanNotBeNull方法的具体用法?Java ExceptionFactory.vertexIdCanNotBeNull怎么用?Java ExceptionFactory.vertexIdCanNotBeNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.tinkerpop.blueprints.util.ExceptionFactory的用法示例。


在下文中一共展示了ExceptionFactory.vertexIdCanNotBeNull方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getVertex

import com.tinkerpop.blueprints.util.ExceptionFactory; //导入方法依赖的package包/类
@Override
public TitanVertex getVertex(final Object id) {
    if (null == id)
        throw ExceptionFactory.vertexIdCanNotBeNull();
    if (id instanceof Vertex) //allows vertices to be "re-attached" to the current transaction
        return getVertex(((Vertex) id).getId());

    final long longId;
    if (id instanceof Long) {
        longId = (Long) id;
    } else if (id instanceof Number) {
        longId = ((Number) id).longValue();
    } else {
        try {
            longId = Long.valueOf(id.toString()).longValue();
        } catch (NumberFormatException e) {
            return null;
        }
    }
    return getVertex(longId);
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:22,代码来源:TitanBlueprintsTransaction.java

示例2: addVertex

import com.tinkerpop.blueprints.util.ExceptionFactory; //导入方法依赖的package包/类
public Vertex addVertex(final Object id, String type, final Object... properties) {
    if (id == null) throw ExceptionFactory.vertexIdCanNotBeNull();
    if (retrieveFromCache(id) != null) throw ExceptionFactory.vertexWithIdAlreadyExists(id);
    nextElement();

    Vertex v = baseGraph.addVertexWithLabel(type);
    if (vertexIdKey != null) {
        v.setProperty(vertexIdKey, id);
    }
    cache.set(v, id);
    final BatchVertex newVertex = new BatchVertex(id);

    setProperties(newVertex, properties);

    return newVertex;
}
 
开发者ID:ldbc,项目名称:ldbc_snb_implementations,代码行数:17,代码来源:TypedBatchGraph.java

示例3: load

import com.tinkerpop.blueprints.util.ExceptionFactory; //导入方法依赖的package包/类
/**
 * Creates a vertex by loading it
 * 
 * @param graph
 *            a ArangoDBGraph
 * @param id
 *            the id (key) of the vertex (can be null)
 * 
 * @throws IllegalArgumentException
 */

static ArangoDBVertex load(ArangoDBGraph graph, Object id) {
	if (id == null) {
		throw ExceptionFactory.vertexIdCanNotBeNull();
	}

	String key = id.toString();

	try {
		ArangoDBSimpleVertex v = graph.getClient().getVertex(graph.getRawGraph(), key);
		return build(graph, v);
	} catch (ArangoDBException e) {
		// nothing found
		logger.debug("graph not found", e);
		return null;
	}
}
 
开发者ID:arangodb,项目名称:blueprints-arangodb-graph,代码行数:28,代码来源:ArangoDBVertex.java

示例4: load

import com.tinkerpop.blueprints.util.ExceptionFactory; //导入方法依赖的package包/类
/**
 * Creates a vertex by loading it
 * 
 * @param graph
 *            a ArangoDBGraph
 * @param id
 *            the id (key) of the vertex (can be null)
 */

static ArangoDBBatchVertex load(ArangoDBBatchGraph graph, Object id) {
	if (id == null) {
		throw ExceptionFactory.vertexIdCanNotBeNull();
	}

	String key = id.toString();

	ArangoDBBatchVertex vert = graph.vertexCache.get(key);
	if (vert != null) {
		return vert;
	}

	try {
		ArangoDBSimpleVertex v = graph.client.getVertex(graph.getRawGraph(), key);
		return build(graph, v);
	} catch (ArangoDBException e) {
		logger.warn("could read batch vertex", e);
		return null;
	}
}
 
开发者ID:arangodb,项目名称:blueprints-arangodb-graph,代码行数:30,代码来源:ArangoDBBatchVertex.java

示例5: getVertex

import com.tinkerpop.blueprints.util.ExceptionFactory; //导入方法依赖的package包/类
@Override
public Vertex getVertex(Object id) {
  if (id == null) {
    throw ExceptionFactory.vertexIdCanNotBeNull();
  }
  String myID = id.toString();

  Vertex vertex = globals.getCaches().retrieve(myID, Vertex.class);
  if (vertex != null) {
    return vertex;
  }

  vertex = new AccumuloVertex(globals, myID);
  if (!globals.getConfig().getSkipExistenceChecks()) {
    // In addition to just an "existence" check, we will also load
    // any "preloaded" properties now, which saves us a round-trip
    // to Accumulo later.
    String[] preload = globals.getConfig().getPreloadedProperties();
    if (preload == null && !globals.getConfig().getPreloadAllProperties()) {
      preload = new String[]{};
    }

    Map<String, Object> props = globals.getVertexWrapper()
        .readProperties(vertex, preload);
    if (props == null) {
      return null;
    }

    for (Entry<String, Object> ents : props.entrySet()) {
      ((AccumuloElement) vertex).setPropertyInMemory(ents.getKey(), ents.getValue());
    }
  }

  globals.getCaches().cache(vertex, Vertex.class);

  return vertex;
}
 
开发者ID:JHUAPL,项目名称:AccumuloGraph,代码行数:38,代码来源:AccumuloGraph.java


注:本文中的com.tinkerpop.blueprints.util.ExceptionFactory.vertexIdCanNotBeNull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。