static Encoding.Presence mapPresence(final PresenceCodec presence)
    {
        switch (presence)
        {
            case SBE_OPTIONAL:
                return Encoding.Presence.OPTIONAL;

            case SBE_CONSTANT:
                return Encoding.Presence.CONSTANT;

            default:
            case SBE_REQUIRED:
                return Encoding.Presence.REQUIRED;
        }
    }
Utility functions for working with {@link Ir}.
sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/IrUtil.java