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


Java ExceptionFactory.propertyKeyLabelIsReservedForEdges方法代码示例

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


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

示例1: setProperty

import com.tinkerpop.blueprints.util.ExceptionFactory; //导入方法依赖的package包/类
@Override
public void setProperty(String key, Object value) {

	if (StringFactory.ID.equals(key)) {
		throw ExceptionFactory.propertyKeyIdIsReserved();
	}

	if (StringFactory.LABEL.equals(key) && this instanceof Edge) {
		throw ExceptionFactory.propertyKeyLabelIsReservedForEdges();
	}

	if (StringUtils.isBlank(key)) {
		throw ExceptionFactory.propertyKeyCanNotBeEmpty();
	}

	try {
		document.setProperty(ArangoDBUtil.normalizeKey(key), value);
		save();
	} catch (ArangoDBException e) {
		logger.debug("error while setting a property", e);
		throw new IllegalArgumentException(e.getMessage());
	}
}
 
开发者ID:arangodb,项目名称:blueprints-arangodb-graph,代码行数:24,代码来源:ArangoDBElement.java

示例2: removeProperty

import com.tinkerpop.blueprints.util.ExceptionFactory; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public <T> T removeProperty(String key) {

	if (StringUtils.isBlank(key)) {
		throw ExceptionFactory.propertyKeyCanNotBeEmpty();
	}

	if (key.equals(StringFactory.LABEL) && this instanceof Edge) {
		throw ExceptionFactory.propertyKeyLabelIsReservedForEdges();
	}

	T o = null;
	try {
		o = (T) document.removeProperty(ArangoDBUtil.normalizeKey(key));
		save();

	} catch (ArangoDBException e) {
		logger.debug("error while removing a property", e);
		throw new IllegalArgumentException(e.getMessage());
	}
	return o;
}
 
开发者ID:arangodb,项目名称:blueprints-arangodb-graph,代码行数:24,代码来源:ArangoDBElement.java

示例3: validateProperty

import com.tinkerpop.blueprints.util.ExceptionFactory; //导入方法依赖的package包/类
/**
 * Ensure that the given key/value don't conflict with
 * Blueprints reserved words.
 * @param key
 * @param value
 */
public static void validateProperty(String key, Object value) {
  nullCheckProperty(key, value);
  if (key.equals(StringFactory.ID)) {
    throw ExceptionFactory.propertyKeyIdIsReserved();
  } else if (key.equals(StringFactory.LABEL)) {
    throw ExceptionFactory.propertyKeyLabelIsReservedForEdges();
  } else if (value == null) {
    throw ExceptionFactory.propertyValueCanNotBeNull();
  }
}
 
开发者ID:JHUAPL,项目名称:AccumuloGraph,代码行数:17,代码来源:AccumuloGraphUtils.java

示例4: checkRemovePropertyKey

import com.tinkerpop.blueprints.util.ExceptionFactory; //导入方法依赖的package包/类
private void checkRemovePropertyKey(String key) {
	if (created) {
		throw new UnsupportedOperationException();
	}

	if (isEmptyString(key))
		throw ExceptionFactory.propertyKeyCanNotBeEmpty();
	if (key.equals(StringFactory.ID))
		throw ExceptionFactory.propertyKeyIdIsReserved();
	if (key.equals(StringFactory.LABEL) && this instanceof Edge)
		throw ExceptionFactory.propertyKeyLabelIsReservedForEdges();
}
 
开发者ID:arangodb,项目名称:blueprints-arangodb-graph,代码行数:13,代码来源:ArangoDBBatchElement.java


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