public static <T, R> R mapTo(T source, Function<T, R> function, R defaultValue) {
        return Optional.ofNullable(source).map(function).orElse(defaultValue);
    }
Get the value of an object that may not be null

@param source original object
@param function conversion method
@param defaultValue default value
@param <T>
@param <R>
@return return value
chat2db-server/chat2db-server-tools/chat2db-server-tools-common/src/main/java/ai/chat2db/server/tools/common/util/EasyOptionalUtils.java