use of com.alibaba.datax.plugin.writer.gdbwriter.model.GdbVertex in project DataX by alibaba.
the class DefaultGdbMapper method addToProperties.
private static boolean addToProperties(final GdbElement e, final String key, final String value, final String type, final String card) {
final Object pValue;
final ValueType valueType = ValueType.fromShortName(type);
if (valueType == ValueType.STRING) {
pValue = value;
} else if (valueType == ValueType.INT || valueType == ValueType.INTEGER) {
pValue = Integer.valueOf(value);
} else if (valueType == ValueType.LONG) {
pValue = Long.valueOf(value);
} else if (valueType == ValueType.DOUBLE) {
pValue = Double.valueOf(value);
} else if (valueType == ValueType.FLOAT) {
pValue = Float.valueOf(value);
} else if (valueType == ValueType.BOOLEAN) {
pValue = Boolean.valueOf(value);
} else {
log.error("invalid property key {}, value {}, type {}", key, value, type);
return false;
}
// apply vertexSetProperty
if (Key.PropertyType.set.name().equals(card) && (e instanceof GdbVertex)) {
e.addProperty(key, pValue, Key.PropertyType.set);
} else {
e.addProperty(key, pValue);
}
return true;
}
Aggregations