@Override public <V> Property<V> property(final String key, final V value) { if (this.removed) throw elementAlreadyRemoved(Edge.class, id); ElementHelper.validateProperty(key, value); final Property oldProperty = super.property(key); final Property<V> newProperty = new TinkerProperty<>(this, key, value); if (null == this.properties) this.properties = new HashMap<>(); this.properties.put(key, newProperty); TinkerHelper.autoUpdateIndex(this, key, value, oldProperty.isPresent() ? oldProperty.value() : null); return newProperty; }
@Override public <V> Property<V> property(final String key, final V value) { if (this.removed) throw elementAlreadyRemoved(Edge.class, id); ElementHelper.validateProperty(key, value); final Property oldProperty = super.property(key); final Property<V> newProperty = new TinkerProperty<>(this, key, value); if (null == this.properties) this.properties = new HashMap<>(); this.properties.put(key, newProperty); TinkerHelper.autoUpdateIndex(this, key, value, oldProperty.isPresent() ? oldProperty.value() : null); return newProperty; }
@Override public <V> Property<V> property(final String key, final V value) { if (this.removed) throw elementAlreadyRemoved(Edge.class, id); ElementHelper.validateProperty(key, value); final Property oldProperty = super.property(key); final Property<V> newProperty = new TinkerProperty<>(this, key, value); if (null == this.properties) this.properties = new HashMap<>(); this.properties.put(key, newProperty); TinkerHelper.autoUpdateIndex(this, key, value, oldProperty.isPresent() ? oldProperty.value() : null); return newProperty; }