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

com.despegar.integration.mongo.query.Update Maven / Gradle / Ivy

There is a newer version: 1.1.10
Show newest version
package com.despegar.integration.mongo.query;

import java.util.HashMap;
import java.util.Map;

public class Update {

    public static enum UpdateOperation {
        SET, UNSET, INC, RENAME, ADD_TO_SET, POP, PULL_ALL, PULL, PUSH
    }

    private Map properties = new HashMap();
    private UpdateOperation updateOperation = null;

    public UpdateOperation getUpdateOperation() {
        return this.updateOperation;
    }

    public Update put(String property, Object value) {

        if (property != null) {
        	Object convertedValue = value instanceof Enum ? value.toString() : value;
            this.getProperties().put(property, convertedValue);
        }

        return this;
    }

    public Map getProperties() {
        return this.properties;
    }

    public void setUpdateOperation(UpdateOperation updateOperation) {
        this.updateOperation = updateOperation;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy