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

cn.leancloud.ops.SetOperation Maven / Gradle / Ivy

package cn.leancloud.ops;

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

/**
 * set attribute to a definitive value.
 */
public class SetOperation extends BaseOperation {
  public SetOperation(String field, Object value) {
    super("Set", field, value, true);
  }

  public Object apply(Object obj) {
    return getValue();
  }

  public Map encode() {
    Map result = new HashMap();
    result.put(getField(), encodeObject(getValue()));
    return result;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy