本文整理汇总了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());
}
}
示例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;
}
示例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();
}
}
示例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();
}