/** * Constructs a new {@link PropertyModel} inferring the generic type arguments of the key and the value. * * @param key The property key or name * @param value The property value * @return A new {@link PropertyModel} based on the given arguments */ public static <K, V> PropertyModel<K, V> with(K key, V value) { return new PropertyModel<>(key, value); }
public void setProperties(Map<String, Object> properties) { this.properties = new ArrayList<>(); for (Map.Entry<String, Object> entry : properties.entrySet()) { this.properties.add(new PropertyModel<>(entry.getKey(), entry.getValue())); } }
public void setProperties(Map<String, Object> properties) { this.properties = new ArrayList<>(); for (Map.Entry<String, Object> entry : properties.entrySet()) { this.properties.add(new PropertyModel<>(entry.getKey(), entry.getValue())); } }
@Override public NodeBuilder setVersionProperty(String name, Long version) { super.targetContainer.setVersion(new PropertyModel<>(name, version)); return this; }
@Override public RelationshipBuilder addProperty(String key, Object value) { super.targetContainer.getPropertyList().add(new PropertyModel<>(key, value)); return this; }
@Override public RelationshipBuilder setVersionProperty(String name, Long version) { super.targetContainer.setVersion(new PropertyModel<>(name, version)); return this; } }
@Override public void addProperty(String key, Object value) { relationship.getPropertyList().add(new PropertyModel<>(key, value)); }
@Override public NodeBuilder addProperty(String key, Object value) { List<Property<String, Object>> propertyList = super.targetContainer.getPropertyList(); for (Property<String, Object> property : propertyList) { if (property.getKey().equals(key)) { throw new MappingException("Node model already contains property: " + key); } } propertyList.add(new PropertyModel<>(key, value)); return this; }
@Override public NodeBuilder addProperty(String key, Object value) { List<Property<String, Object>> propertyList = node.getPropertyList(); for (Property<String, Object> property : propertyList) { if (property.getKey().equals(key)) { throw new MappingException("Node model already contains property: " + key); } } propertyList.add(new PropertyModel<>(key, value)); return this; }