mapToArray becomes public (to be used in e.g. server-side custom EnumProvider)