class MessageConverter {

    static BuildMessage convertMessage(final Message message,
                                       Handles handles) {
        final BuildMessage m = new BuildMessage();
        switch (message.getLevel()) {
            case ERROR:
                m.setLevel(Level.ERROR);
                break;
            case WARNING:
                m.setLevel(Level.WARNING);
                break;
            case INFO:
                m.setLevel(Level.INFO);
                break;
        }

        m.setId(message.getId());
        m.setLine(message.getLine());
        m.setPath(convertPath(message.getPath(),
                              handles));
        m.setColumn(message.getColumn());
        m.setText(convertMessageText(message));
        return m;
    }

}