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


Java Element.getProperty方法代码示例

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


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

示例1: resolve

import com.tinkerpop.blueprints.Element; //导入方法依赖的package包/类
@Override
public <T> Class<? extends T> resolve(final Element element, final Class<T> kind) {
	final String nodeClazz = element.getProperty(this.typeResolutionKey);
	if (nodeClazz == null) {
		return kind;
	}

	final Class<T> nodeKind = (Class<T>) this.reflectionCache.forName(nodeClazz);

	if (kind.isAssignableFrom(nodeKind) || kind.equals(VertexFrame.class) || kind.equals(EdgeFrame.class)
			|| kind.equals(AbstractVertexFrame.class) || kind.equals(AbstractEdgeFrame.class) || kind.equals(Object.class)) {
		return nodeKind;
	} else {
		return kind;
	}
}
 
开发者ID:gentics,项目名称:mesh,代码行数:17,代码来源:MeshTypeResolver.java

示例2: verifyElementOrder

import com.tinkerpop.blueprints.Element; //导入方法依赖的package包/类
public static void verifyElementOrder(Iterator<? extends Element> elements, String key, Order order, int expectedCount) {
    Comparable previous = null;
    int count = 0;
    while (elements.hasNext()) {
        Element element = elements.next();
        Comparable current = (Comparable)element.getProperty(key);
        if (previous != null) {
            int cmp = previous.compareTo(current);
            assertTrue(previous + " <> " + current + " @ " + count,
                    order == Order.ASC ? cmp <= 0 : cmp >= 0);
        }
        previous = current;
        count++;
    }
    assertEquals(expectedCount, count);
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:17,代码来源:TestUtil.java

示例3: 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));
        }
      }
    }
  }
}
 
开发者ID:SciGraph,项目名称:SciGraph,代码行数:19,代码来源:ArrayPropertyTransformer.java

示例4: setPropertyForIndex

import com.tinkerpop.blueprints.Element; //导入方法依赖的package包/类
/**
 * Add the property to this index.
 * 
 * <p/>Note that this requires a round-trip to Accumulo to see
 * if the property exists if the provided key has an index.
 * So for best performance, create indices after bulk ingest.
 * <p/>If the force parameter is true, set the property regardless
 * of whether indexing is enabled for the given key. This is needed
 * for {@link IndexableGraph} operations.
 * @param element
 * @param key
 * @param value
 * @param force
 */
public void setPropertyForIndex(Element element, String key, Object value,
    boolean force) {
  AccumuloGraphUtils.validateProperty(key, value);
  if (force || globals.getConfig().getAutoIndex() ||
      globals.getIndexMetadataWrapper()
      .getIndexedKeys(elementType).contains(key)) {
    BatchWriter writer = getWriter();

    Object oldValue = element.getProperty(key);
    if (oldValue != null && !oldValue.equals(value)) {
      Mutators.apply(writer, new IndexValueMutator.Delete(element, key, oldValue));
    }

    Mutators.apply(writer, new IndexValueMutator.Add(element, key, value));
    globals.checkedFlush();
  }
}
 
开发者ID:JHUAPL,项目名称:AccumuloGraph,代码行数:32,代码来源:BaseIndexValuesTableWrapper.java

示例5: migrateType

import com.tinkerpop.blueprints.Element; //导入方法依赖的package包/类
/**
 * Change type: com.gentics.mesh.core.data.impl.UserImpl to UserImpl
 * 
 * @param element
 */
private void migrateType(Element element) {
	String type = element.getProperty("ferma_type");
	if (!StringUtils.isEmpty(type)) {
		int idx = type.lastIndexOf(".");
		if (idx != -1) {
			type = type.substring(idx + 1);
			element.setProperty("ferma_type", type);
		}
	}
}
 
开发者ID:gentics,项目名称:mesh,代码行数:16,代码来源:ChangeAddVersioning.java

示例6: getProperty

import com.tinkerpop.blueprints.Element; //导入方法依赖的package包/类
public static <O> Function<Element, O> getProperty( final String key ) {
  return new Function<Element, O>() {
    @Override public O apply( Element input ) {
      return input.getProperty( key );
    }
  };
}
 
开发者ID:mattyb149,项目名称:pdi-layout,代码行数:8,代码来源:GraphUtils.java

示例7: resolve

import com.tinkerpop.blueprints.Element; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public <T extends FramedElement> Class<T> resolve(Element element, Class<T> kind) {
	String clazz = element.getProperty("java_class");
	if (clazz != null) {
		try {
			return (Class<T>) Class.forName(clazz);
		} catch (ClassNotFoundException e) {
			throw new RuntimeException("The class " + clazz + " cannot be found");
		}
	}
	return kind;
}
 
开发者ID:BrynCooke,项目名称:totorom,代码行数:14,代码来源:TypeResolver.java

示例8: init

import com.tinkerpop.blueprints.Element; //导入方法依赖的package包/类
@Override
public <T extends FramedElement> void init(Element element, Class<T> kind) {
	String clazz = element.getProperty("java_class");
	if (clazz == null) {
		element.setProperty("java_class", kind.getName());
	}
}
 
开发者ID:BrynCooke,项目名称:totorom,代码行数:8,代码来源:TypeResolver.java

示例9: 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);
  }
}
 
开发者ID:SciGraph,项目名称:SciGraph,代码行数:14,代码来源:TinkerGraphUtil.java

示例10: compare

import com.tinkerpop.blueprints.Element; //导入方法依赖的package包/类
@Override
public int compare(Element o1, Element o2) {
	String uuidA = o1.getProperty("uuid");
	String uuidB = o2.getProperty("uuid");
	return ObjectUtils.compare(uuidA, uuidB);
}
 
开发者ID:gentics,项目名称:mesh,代码行数:7,代码来源:ElementUuidComparator.java

示例11: invoke

import com.tinkerpop.blueprints.Element; //导入方法依赖的package包/类
@Override
public Object invoke(Element propertyContainer, Object instance,
		Object[] args) {
	return propertyContainer.getProperty("test") + "_get";
}
 
开发者ID:PureSolTechnologies,项目名称:extended-objects-titan,代码行数:6,代码来源:GetMethod.java


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