All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.moaxcp.graphs.events.VertexPropertyUpdated Maven / Gradle / Ivy

There is a newer version: 0.3.0
Show newest version
package com.github.moaxcp.graphs.events;

import static java.util.Objects.requireNonNull;
import java.util.Objects;

public final class VertexPropertyUpdated extends VertexPropertyEvent {
    private final Object oldValue;

    private VertexPropertyUpdated(Builder builder) {
        super(builder);
        oldValue = requireNonNull(builder.oldValue);
    }

    public Object getOldValue() {
        return oldValue;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        VertexPropertyUpdated that = (VertexPropertyUpdated) o;
        return Objects.equals(getGraphId(), that.getGraphId()) &&
                Objects.equals(getVertexId(), that.getVertexId()) &&
                Objects.equals(getName(), that.getName()) &&
                Objects.equals(getValue(), that.getValue()) &&
                Objects.equals(oldValue, that.oldValue);
    }

    @Override
    public int hashCode() {
        return Objects.hash(getGraphId(), getVertexId(), getName(), getValue(), oldValue);
    }

    @SuppressWarnings("squid:S2176")
    public static final class Builder extends VertexPropertyEvent.Builder> {
        private Object oldValue;

        @Override
        public Builder self() {
            return this;
        }

        public Builder oldValue(Object oldValue) {
            this.oldValue = oldValue;
            return this;
        }

        @Override
        public VertexPropertyUpdated build() {
            return new VertexPropertyUpdated<>(this);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy