/*
 *  Copyright (C) 2018-2020 Stichting Akvo (Akvo Foundation)
 *
 *  This file is part of Akvo FLOW.
 *
 *  Akvo FLOW is free software: you can redistribute it and modify it under the terms of
 *  the GNU Affero General Public License (AGPL) as published by the Free Software Foundation,
 *  either version 3 of the License or any later version.
 *
 *  Akvo FLOW is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 *  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *  See the GNU Affero General Public License included below for more details.
 *
 *  The full license text can also be seen at <http://www.gnu.org/licenses/agpl.html>.
 */

package com.gallatinsystems.survey.domain;

import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

public class WebForm {
   
    public static boolean validWebForm(final List<Question> questions){
        Set<Question.Type> set = new HashSet<Question.Type>();
        set.add(Question.Type.CASCADE);
        set.add(Question.Type.GEOSHAPE);
        set.add(Question.Type.SIGNATURE);
        set.add(Question.Type.CADDISFLY);        
        
        List<Question> validQuestions = questions.stream().filter(i -> !set.contains(i.getType())).collect(Collectors.toList());

        return validQuestions.size() == questions.size();
    }

}
@@ -878,19 +878,16 @@
 bForm %7B%0A
-   
 %0A    pub
@@ -901,259 +901,329 @@
 tic 
-boolean validWebForm(final List%3CQuestion%3E questions)%7B%0A        Set%3CQuestion.Type%3E set = new HashSet%3CQuestion.Type%3E();%0A        set.add(Question.Type.CASCADE);%0A        set.add(Question.Type.GEOSHAPE);%0A        set.add(Question.Type.SIGNATURE);%0A        set
+Set%3CString%3E unsupportedQuestionTypes()%7B%0A        Set%3CString%3E unsupportedTypes = new HashSet%3CString%3E();%0A        unsupportedTypes.add(Question.Type.CASCADE.toString());%0A        unsupportedTypes.add(Question.Type.GEOSHAPE.toString());%0A        unsupportedTypes.add(Question.Type.SIGNATURE.toString());%0A        unsupportedTypes
 .add
@@ -1250,18 +1250,30 @@
 SFLY
+.toString()
 );
+%0A
         
 %0A   
@@ -1260,32 +1260,135 @@
 ing());%0A        
+return unsupportedTypes;%0A    %7D%0A%0A    public static boolean validWebForm(final List%3CQuestion%3E questions)%7B
 %0A        %0A      
@@ -1457,11 +1457,34 @@
 -%3E !
-set
+unsupportedQuestionTypes()
 .con
@@ -1500,16 +1500,27 @@
 etType()
+.toString()
 )).colle

use string type in unsupportedQuestionTypes