if (!encodingExpression.evaluate(tuple, ptr)) {
return false;
}
if (ptr.getLength() == 0) {
throw new IllegalDataException(getMissingEncodeFormatMsg());
}
PDataType type = encodingExpression.getDataType();
String encodingFormat = ((String) type.toObject(ptr)).toUpperCase();
EncodeFormat format = EncodeFormat.valueOf(encodingFormat);
switch (format) {
case BASE62:
String encodedString = Base62Encoder.toString(num);
ptr.set(PDataType.VARCHAR.toBytes(encodedString));
break;
default:
throw new IllegalDataException(getUnsupportedEncodeFormatMsg(encodingFormat));
}
return true;
}