class MessageComponent extends FieldMap {

    public void copyTo(FieldMap fields) {
        try {
            for (int componentField : this.fields.keySet()) {
                fields.setField(componentField, getField(componentField));
            }
            for (int groupField : this.groups.keySet()) {
                fields.setField(groupField, getField(groupField));
                fields.setGroups(groupField, getGroups(groupField));
            }
        } catch (FieldNotFound e) {
            // should not happen
        }
    }

    protected  MessageComponent();
    protected  MessageComponent(int[] fieldOrder);

}