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

            case CONSTANT:
                return PresenceCodec.SBE_CONSTANT;

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