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


Java PropertyContainer.setProperty方法代码示例

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


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

示例1: setProperties

import org.neo4j.graphdb.PropertyContainer; //导入方法依赖的package包/类
private static void setProperties( PropertyContainer entity, Object... properties )
{
    for ( Map.Entry<String, Object> entry : MapUtil.map( properties ).entrySet() )
    {
        entity.setProperty( entry.getKey(), entry.getValue() );
    }
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-lucene5-index,代码行数:8,代码来源:AbstractLuceneIndexTest.java

示例2: addProperty

import org.neo4j.graphdb.PropertyContainer; //导入方法依赖的package包/类
/***
 * Add a property value to a container.
 * 
 * Abstracts dealing with underlying value arrays. The property may already have a value.
 * 
 * @param container the {@link PropertyContainer} in question
 * @param property the name of the property to append
 * @param value the value to append
 */
public static void addProperty(PropertyContainer container, String property, Object value) {
  if (container.hasProperty(property)) {
    Object origValue = container.getProperty(property);
    Object newValue = getNewPropertyValue(origValue, value);
    container.setProperty(property, newValue);
  } else {
    container.setProperty(property, value);
  }
}
 
开发者ID:SciGraph,项目名称:SciGraph,代码行数:19,代码来源:GraphUtil.java

示例3: addProperties

import org.neo4j.graphdb.PropertyContainer; //导入方法依赖的package包/类
private void addProperties(PropertyContainer entity, Map properties) {
    for (Object key : properties.keySet()) {
        String keyString = key.toString();
        Object value = properties.get(key);
        if (value instanceof List) {
            List listValue = (List) value;
            int listValueSize = listValue.size();
            if (listValueSize >= 1) {
                Object firstItem = listValue.get(0);
                try {
                    if (firstItem instanceof Boolean) {
                        entity.setProperty(keyString, listValue.toArray(new Boolean[listValueSize]));
                    } else if (firstItem instanceof Integer) {
                        entity.setProperty(keyString, listValue.toArray(new Integer[listValueSize]));
                    } else if (firstItem instanceof Long) {
                        entity.setProperty(keyString, listValue.toArray(new Long[listValueSize]));
                    } else if (firstItem instanceof Double) {
                        entity.setProperty(keyString, listValue.toArray(new Double[listValueSize]));
                    } else if (firstItem instanceof String) {
                        entity.setProperty(keyString, listValue.toArray(new String[listValueSize]));
                    } else {
                        throw new ClassCastException("Cannot cast List property to a supported type");
                    }
                } catch (ArrayStoreException ex) {
                    throw new ClassCastException("Cannot cast List property to a supported type");
                }
            } else {
                entity.setProperty(keyString, new String[0]);
            }
        } else {
            entity.setProperty(keyString, value);
        }
    }
}
 
开发者ID:technige,项目名称:zerograph,代码行数:35,代码来源:Database.java

示例4: addCreatedTimestampFor

import org.neo4j.graphdb.PropertyContainer; //导入方法依赖的package包/类
private void addCreatedTimestampFor(Iterable<? extends PropertyContainer> propertyContainers, long currentTime) {
  if (propertyContainers == null) return;
  for (PropertyContainer propertyContainer : propertyContainers) {
    if (!propertyContainer.hasProperty(CREATED_TIMESTAMP_PROPERTY_NAME)){
      propertyContainer.setProperty(CREATED_TIMESTAMP_PROPERTY_NAME, currentTime);
    }
  }
}
 
开发者ID:ttiurani,项目名称:neo4j-timestamp,代码行数:9,代码来源:TimestampTransactionEventHandler.java

示例5: assignCreated

import org.neo4j.graphdb.PropertyContainer; //导入方法依赖的package包/类
private void assignCreated(PropertyContainer container) {
    container.setProperty(configuration.getCreatedProperty(), System.currentTimeMillis());
}
 
开发者ID:travessey,项目名称:neo4j-timestamper,代码行数:4,代码来源:TimestamperModule.java

示例6: assignUpdated

import org.neo4j.graphdb.PropertyContainer; //导入方法依赖的package包/类
private void assignUpdated(PropertyContainer container) {
  container.setProperty(configuration.getUpdatedProperty(), System.currentTimeMillis());
}
 
开发者ID:travessey,项目名称:neo4j-timestamper,代码行数:4,代码来源:TimestamperModule.java

示例7: copyProperties

import org.neo4j.graphdb.PropertyContainer; //导入方法依赖的package包/类
private void copyProperties(PropertyContainer source, PropertyContainer target) {
  for (String key : source.getPropertyKeys())
    target.setProperty(key, source.getProperty(key));
}
 
开发者ID:SciGraph,项目名称:SciGraph,代码行数:5,代码来源:Clique.java

示例8: addProperties

import org.neo4j.graphdb.PropertyContainer; //导入方法依赖的package包/类
public void addProperties(PropertyContainer entity, Map<String, Object> properties) {
    for (String key : properties.keySet()) {
        entity.setProperty(key, properties.get(key));
    }
}
 
开发者ID:technige,项目名称:zerograph,代码行数:6,代码来源:ResourceTest.java

示例9: addProperties

import org.neo4j.graphdb.PropertyContainer; //导入方法依赖的package包/类
public void addProperties(PropertyContainer entity, Map properties) {
    for (Object key : properties.keySet()) {
        entity.setProperty(key.toString(), properties.get(key));
    }
}
 
开发者ID:TinderBackend,项目名称:neo4j-zmq-extension,代码行数:6,代码来源:PropertyContainerResource.java

示例10: updateTimestampsFor

import org.neo4j.graphdb.PropertyContainer; //导入方法依赖的package包/类
private void updateTimestampsFor(Iterable<? extends PropertyContainer> propertyContainers, long currentTime) {
  if (propertyContainers == null) return;
  for (PropertyContainer propertyContainer : propertyContainers) {
    propertyContainer.setProperty(MODIFIED_TIMESTAMP_PROPERTY_NAME, currentTime);
  }
}
 
开发者ID:ttiurani,项目名称:neo4j-timestamp,代码行数:7,代码来源:TimestampTransactionEventHandler.java


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