class MessageComponent extends FieldMap {

    public void copyFrom(FieldMap fields) {
        try {
            for (int componentField : getFields()) {
                if (fields.isSetField(componentField)) {
                    setField(componentField, fields.getField(componentField));
                }
            }
            for (int groupField : getGroupFields()) {
                if (fields.isSetField(groupField)) {
                    setField(groupField, fields.getField(groupField));
                    setGroups(groupField, fields.getGroups(groupField));
                }
            }
        } catch (FieldNotFound e) {
            // should not happen
        }
    }

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

}