@Override
        public Value evaluate(List<Value> arguments) {
            String str = arguments.get(0).expectStringValue().getValue();
            int startIndex = arguments.get(1).expectIntegerValue().getValue();
            int stopIndex = arguments.get(2).expectIntegerValue().getValue();
            boolean reverse = arguments.get(3).expectBooleanValue().getValue();
            String result = getSubstring(str, startIndex, stopIndex, reverse);
            return result == null ? Value.emptyValue() : Value.stringValue(result);
        }
A {@link FunctionDefinition} for the {@link Substring} function.
smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/syntax/expressions/functions/Substring.java