private Object resolveValue(Object builder, String methodName, Object rawValue) {
        if (rawValue instanceof ConfigBuilder) // Value in a map
            return rawValue;
        Inspector value = (Inspector)rawValue;
        if (isPathField(builder, methodName))
            return resolvePath(value.asString());
        if (isOptionalPathField(builder, methodName)) {
            String v = value.asString();
            return resolvePath(v.isEmpty() ? Optional.empty() : Optional.of(v));
        } else if (isUrlField(builder, methodName))
            return value.asString().isEmpty() ? "" : resolveUrl(value.asString());
        else if (isModelField(builder, methodName))
            return value.asString().isEmpty() ? "" : resolveModel(value.asString());
        else
            return getValueFromInspector(value);
    }
A utility class that can be used to apply a payload to a config builder.

TODO: This can be refactored a lot, since many of the reflection methods are duplicated

@author Ulf Lilleengen
@author hmusum
@author Tony Vaagenes
config/src/main/java/com/yahoo/vespa/config/ConfigPayloadApplier.java