@Override
    public <V> Property<V> property(final String key, final V value) {
        graph.touch(this);

        if (this.removed) throw elementAlreadyRemoved(Edge.class, id);
        ElementHelper.validateProperty(key, value);

        if (!allowNullPropertyValues && null == value) {
            properties(key).forEachRemaining(Property::remove);
            return Property.empty();
        }

        final Property oldProperty = super.property(key);
        final Property<V> newProperty = new TinkerProperty<>(this, key, value);
        if (null == this.properties) this.properties = new ConcurrentHashMap<>();
        this.properties.put(key, newProperty);
        TinkerIndexHelper.autoUpdateIndex(this, key, value, oldProperty.isPresent() ? oldProperty.value() : null);
        return newProperty;
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerEdge.java