
apoc.diff.SourceDestConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of apoc Show documentation
Show all versions of apoc Show documentation
A collection of useful Neo4j Procedures
package apoc.diff;
import java.util.Collections;
import java.util.Map;
public class SourceDestConfig {
public enum SourceDestConfigType { URL, DATABASE }
static class TargetConfig {
private final SourceDestConfigType type;
private final String value;
public TargetConfig(SourceDestConfigType type, String value) {
this.type = type;
this.value = value;
}
public SourceDestConfigType getType() {
return type;
}
public String getValue() {
return value;
}
}
private final Map params;
private final TargetConfig target;
public SourceDestConfig(SourceDestConfigType type, String value, Map params) {
this.target = new TargetConfig(type, value);
this.params = params;
}
public TargetConfig getTarget() {
return target;
}
public Map getParams() {
return params;
}
public static SourceDestConfig fromMap(Map map) {
map = map == null ? Collections.emptyMap() : map;
if (map.isEmpty()) {
return null;
} else {
Map target = (Map) map.getOrDefault("target", Collections.emptyMap());
SourceDestConfigType type = SourceDestConfigType
.valueOf((String) target.getOrDefault("type", SourceDestConfigType.URL.toString()));
return new SourceDestConfig(type,
(String) target.get("value"),
(Map) map.getOrDefault("params", Collections.emptyMap()));
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy