class CalciteMessageFactory implements MessageFactoryProvider {
    /** {@inheritDoc} */
    @SuppressWarnings({"unchecked", "rawtypes"})
    @Override public void registerAll(IgniteMessageFactory factory) {
        for (MessageType type : MessageType.values())
            factory.register(type.directType(), (Supplier)type.factory());
    }

    /**
     * Produces a value message.
     */
    public static ValueMessage asMessage(Object val) {<FILL_FUNCTION_BODY>}
}

        if (val == null)
            return null;

        return new GenericValueMessage(val);
    
<no_super_class>