@@ -0,0 +1,3912 @@
+package com.ushahidi.android.presentation.model.mapper;%0A%0Aimport com.ushahidi.android.domain.entity.FormAttribute;%0Aimport com.ushahidi.android.presentation.model.FormAttributeModel;%0A%0Aimport android.support.annotation.Nullable;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport javax.inject.Inject;%0A%0A/**%0A * @author Ushahidi Team %3Cteam@ushahidi.com%3E%0A */%0Apublic class FormAttributeModelDataMapper %7B%0A%0A    /**%0A     * Default constructor%0A     */%0A    @Inject%0A    public FormAttributeModelDataMapper() %7B%0A        // Do nothing%0A    %7D%0A%0A    /**%0A     * Maps %7B@link FormAttributeModel%7D to %7B@link FormAttribute%7D%0A     *%0A     * @param formAttributeModel The form entity to be mapped%0A     * @return The mapped form entity%0A     */%0A    @Nullable%0A    public FormAttribute map(FormAttributeModel formAttributeModel) %7B%0A        FormAttribute formAttribute = null;%0A        if (formAttributeModel != null) %7B%0A            formAttribute = new FormAttribute();%0A            formAttribute._id = formAttributeModel._id;%0A            formAttribute.setCardinality(formAttributeModel.getCardinality());%0A            formAttribute.setPriority(formAttributeModel.getPriority());%0A            formAttribute.setKey(formAttributeModel.getKey());%0A            formAttribute.setDeploymentId(formAttributeModel.getDeploymentId());%0A            formAttribute.setOptions(formAttributeModel.getOptions());%0A            formAttribute.setFormId(formAttributeModel.getFormId());%0A            formAttribute.setRequired(formAttributeModel.getRequired());%0A            formAttribute%0A                    .setInput(FormAttribute.Input.valueOf(formAttributeModel.getInput().name()));%0A            formAttribute.setType(FormAttribute.Type.valueOf(formAttributeModel.getType().name()));%0A            formAttribute.setLabel(formAttributeModel.getLabel());%0A        %7D%0A        return formAttribute;%0A    %7D%0A%0A    /**%0A     * Maps %7B@link FormAttribute%7D to %7B@link FormAttributeModel%7D%0A     *%0A     * @param formAttribute The form to be mapped%0A     * @return The mapped form%0A     */%0A    @Nullable%0A    public FormAttributeModel map(FormAttribute formAttribute) %7B%0A        FormAttributeModel formAttributeModel = null;%0A        if (formAttribute != null) %7B%0A            formAttributeModel = new FormAttributeModel();%0A            formAttributeModel._id = formAttribute._id;%0A            formAttributeModel.setCardinality(formAttribute.getCardinality());%0A            formAttributeModel.setPriority(formAttribute.getPriority());%0A            formAttributeModel.setKey(formAttribute.getKey());%0A            formAttributeModel.setDeploymentId(formAttribute.getDeploymentId());%0A            formAttributeModel.setOptions(formAttribute.getOptions());%0A            formAttributeModel.setFormId(formAttribute.getFormId());%0A            formAttributeModel.setRequired(formAttribute.getRequired());%0A            formAttributeModel%0A                    .setInput(FormAttributeModel.Input.valueOf(formAttribute.getInput().name()));%0A            formAttributeModel%0A                    .setType(FormAttributeModel.Type.valueOf(formAttribute.getType().name()));%0A            formAttributeModel.setLabel(formAttribute.getLabel());%0A        %7D%0A        return formAttributeModel;%0A    %7D%0A%0A    /**%0A     * Maps a list of %7B@link FormAttributeModel%7D to a list of %7B@link FormAttribute%7D%0A     *%0A     * @param formAttributeModelList The form entity list%0A     * @return The mapped form entity list%0A     */%0A    @Nullable%0A    public List%3CFormAttribute%3E map(List%3CFormAttributeModel%3E formAttributeModelList) %7B%0A        List%3CFormAttribute%3E formAttributeList = null;%0A        if (formAttributeModelList != null) %7B%0A            formAttributeList = new ArrayList%3C%3E();%0A            for (FormAttributeModel formAttributeModel : formAttributeModelList) %7B%0A                FormAttribute formAttribute = map(formAttributeModel);%0A                formAttributeList.add(formAttribute);%0A            %7D%0A        %7D%0A        return formAttributeList;%0A    %7D%0A%7D%0A

Add form attribute mapper