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

co.easimart.EasimartDeleteOperation Maven / Gradle / Ivy

package co.easimart;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * An operation where a field is deleted from the object.
 */
/** package */ class EasimartDeleteOperation implements EasimartFieldOperation {
  private static final EasimartDeleteOperation defaultInstance = new EasimartDeleteOperation();

  public static EasimartDeleteOperation getInstance() {
    return defaultInstance;
  }

  private EasimartDeleteOperation() {
  }

  @Override
  public JSONObject encode(EasimartEncoder objectEncoder) throws JSONException {
    JSONObject output = new JSONObject();
    output.put("__op", "Delete");
    return output;
  }

  @Override
  public EasimartFieldOperation mergeWithPrevious(EasimartFieldOperation previous) {
    return this;
  }

  @Override
  public Object apply(Object oldValue, String key) {
    return null;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy