Jackson deserialization for ReconMatchBestCandidatesOperation
This commit is contained in:
parent
d908635c1f
commit
fb584e0b5f
@ -39,6 +39,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
import com.google.refine.browsing.EngineConfig;
|
import com.google.refine.browsing.EngineConfig;
|
||||||
@ -55,19 +56,19 @@ import com.google.refine.model.Row;
|
|||||||
import com.google.refine.model.changes.CellChange;
|
import com.google.refine.model.changes.CellChange;
|
||||||
import com.google.refine.model.changes.ReconChange;
|
import com.google.refine.model.changes.ReconChange;
|
||||||
import com.google.refine.operations.EngineDependentMassCellOperation;
|
import com.google.refine.operations.EngineDependentMassCellOperation;
|
||||||
|
import com.google.refine.util.ParsingUtilities;
|
||||||
|
|
||||||
public class ReconMatchBestCandidatesOperation extends EngineDependentMassCellOperation {
|
public class ReconMatchBestCandidatesOperation extends EngineDependentMassCellOperation {
|
||||||
static public AbstractOperation reconstruct(Project project, JSONObject obj) throws Exception {
|
static public AbstractOperation reconstruct(Project project, JSONObject obj) throws Exception {
|
||||||
JSONObject engineConfig = obj.getJSONObject("engineConfig");
|
return ParsingUtilities.mapper.readValue(obj.toString(), ReconMatchBestCandidatesOperation.class);
|
||||||
String columnName = obj.getString("columnName");
|
|
||||||
|
|
||||||
return new ReconMatchBestCandidatesOperation(
|
|
||||||
EngineConfig.reconstruct(engineConfig),
|
|
||||||
columnName
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ReconMatchBestCandidatesOperation(EngineConfig engineConfig, String columnName) {
|
@JsonCreator
|
||||||
|
public ReconMatchBestCandidatesOperation(
|
||||||
|
@JsonProperty("engineConfig")
|
||||||
|
EngineConfig engineConfig,
|
||||||
|
@JsonProperty("columnName")
|
||||||
|
String columnName) {
|
||||||
super(engineConfig, columnName, false);
|
super(engineConfig, columnName, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user