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


Java ExceptionFactory.propertyKeyCanNotBeEmpty方法代码示例

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


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

示例1: setProperty

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

	if (isEmptyString(key))
		throw ExceptionFactory.propertyKeyCanNotBeEmpty();
	if (key.equals(StringFactory.ID))
		throw ExceptionFactory.propertyKeyIdIsReserved();

	try {
		document.setProperty(ArangoDBUtil.normalizeKey(key), value);
	} catch (ArangoDBException e) {
		logger.warn("could not set property", e);
		throw new IllegalArgumentException(e.getMessage());
	}
}
 
开发者ID:arangodb,项目名称:blueprints-arangodb-graph,代码行数:19,代码来源:ArangoDBBatchElement.java

示例2: 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

示例3: 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

示例4: nullCheckProperty

import com.tinkerpop.blueprints.util.ExceptionFactory; //导入方法依赖的package包/类
/**
 * Disallow null keys/values and throw appropriate
 * Blueprints exceptions.
 * @param key
 * @param value
 */
public static void nullCheckProperty(String key, Object value) {
  if (key == null) {
    throw ExceptionFactory.propertyKeyCanNotBeNull();
  } else if (value == null) {
    throw ExceptionFactory.propertyValueCanNotBeNull();
  } else if (key.trim().equals(StringFactory.EMPTY_STRING)) {
    throw ExceptionFactory.propertyKeyCanNotBeEmpty();
  }
}
 
开发者ID:JHUAPL,项目名称:AccumuloGraph,代码行数:16,代码来源:AccumuloGraphUtils.java

示例5: 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.propertyKeyCanNotBeEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。