static Val create(final Object object) {
        return switch (object) {
            case null -> ValNull.INSTANCE;
            case Boolean val -> ValBoolean.create(val);
            case Double val -> ValDouble.create(val);
            case Duration val -> ValDuration.create(val.toMillis());
            case Float val -> ValFloat.create(val);
            case Instant val -> ValDate.create(val.toEpochMilli());
            case Integer val -> ValInteger.create(val);
            case Long val -> ValLong.create(val);
            case String val -> ValString.create(val);
            case StroomDuration val -> ValDuration.create(val.toMillis());
            case Throwable val -> ValErr.create(val.getMessage());
            case Val val -> val;
            default -> throw new UnsupportedOperationException("Unsupported type " + object.getClass());
        };
    }
Create a {@link Val} of the appropriate subclass for the java
type passed, e.g.
<pre>
{@link String} => {@link ValString},
{@link Long} => {@link ValLong},
{@link Instant} => {@link ValDate},
{@link Duration} => {@link ValDuration},
{@link Throwable} => {@link ValErr},
null => {@link ValNull},
etc
</pre>
stroom-query/stroom-query-language/src/main/java/stroom/query/language/functions/Val.java