本文整理汇总了Java中com.tinkerpop.blueprints.Element.getPropertyKeys方法的典型用法代码示例。如果您正苦于以下问题:Java Element.getPropertyKeys方法的具体用法?Java Element.getPropertyKeys怎么用?Java Element.getPropertyKeys使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.tinkerpop.blueprints.Element
的用法示例。
在下文中一共展示了Element.getPropertyKeys方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: transform
import com.tinkerpop.blueprints.Element; //导入方法依赖的package包/类
static void transform(Iterable<? extends Element> elements) {
for (Element element: elements) {
for (String key: element.getPropertyKeys()) {
if (PROTECTED_PROPERTY_KEYS.contains(key)) {
continue;
} else {
Object value = element.getProperty(key);
if (value instanceof Iterable) {
// Leave it
} else if (value.getClass().isArray()) {
element.setProperty(key, Arrays.asList(value));
} else {
element.setProperty(key, newArrayList(value));
}
}
}
}
}
示例2: debug
import com.tinkerpop.blueprints.Element; //导入方法依赖的package包/类
public void debug(Element element) {
System.out.println("---");
for (String key : element.getPropertyKeys()) {
System.out.println(key + " : " + element.getProperty(key));
}
System.out.println("---");
}
示例3: getElementPropertyKeys
import com.tinkerpop.blueprints.Element; //导入方法依赖的package包/类
private static Set<String> getElementPropertyKeys(final Element element, final boolean edgeIn) {
final Set<String> elementPropertyKeys = new HashSet<String>(element.getPropertyKeys());
elementPropertyKeys.add(GraphSONTokens._ID);
if (element instanceof Edge) {
if (edgeIn) {
elementPropertyKeys.add(GraphSONTokens._IN_V);
} else {
elementPropertyKeys.add(GraphSONTokens._OUT_V);
}
elementPropertyKeys.add(GraphSONTokens._LABEL);
}
return elementPropertyKeys;
}
示例4: copyProperties
import com.tinkerpop.blueprints.Element; //导入方法依赖的package包/类
static void copyProperties(Element source, Element target) {
for (String key : source.getPropertyKeys()) {
Object property = source.getProperty(key);
if (property.getClass().isArray()) {
List<Object> propertyList = new ArrayList<>();
for (int i = 0; i < Array.getLength(property); i++) {
propertyList.add(Array.get(property, i));
}
property = propertyList;
}
target.setProperty(key, property);
}
}
示例5: dumpProperties
import com.tinkerpop.blueprints.Element; //导入方法依赖的package包/类
public static void dumpProperties(Element container) {
for (String key: container.getPropertyKeys()) {
System.out.println(key + ": " + container.getProperty(key));
}
}