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

com.rbmhtechnology.vind.api.query.update.UpdateOperation Maven / Gradle / Ivy

There is a newer version: 3.2.0
Show newest version
package com.rbmhtechnology.vind.api.query.update;

import java.util.Objects;

import static com.rbmhtechnology.vind.api.query.update.Update.*;

/**
 * Created by fonso on 31.05.17.
 */
public class UpdateOperation implements Comparable{

    private UpdateOperations type;
    private Object value;

    public UpdateOperation(UpdateOperations type,  Object value) {
        this.type = type;
        this.value = value;
    }

    public UpdateOperations getType() {
        return type;
    }

    public Object getValue() {
        return value;
    }

    @Override
    public int compareTo(Object o) {
        if(UpdateOperation.class.isAssignableFrom(o.getClass())) {
            final UpdateOperation o1 = (UpdateOperation) o;
            if(o1.getType().equals(this.getType()) && Objects.equals(this.getValue(), o1.getValue())) {
                return 0;
            }
        }
        return 1;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy