1 package junitx.ddtunit.data; 2 3 import java.util.ArrayList; 4 import java.util.Comparator; 5 import java.util.Iterator; 6 7 public class SearchParameters { 8 9 public SearchParameters() { 10 } 11 12 public SearchParameters(String testDataId, Object searchedValue, Comparator<?> comparator) { 13 addParameter(testDataId, searchedValue, comparator); 14 } 15 16 public SearchParameters(String testDataId, Object searchedValue) { 17 addParameter(testDataId, searchedValue); 18 } 19 20 ArrayList<SearchParameter> parameters = new ArrayList<SearchParameter>(); 21 22 DefaultComparator defaultComparator = new DefaultComparator(); 23 24 public void addParameter(String testDataId, Object searchedValue, Comparator<?> comparator) { 25 SearchParameter parameter = new SearchParameter(searchedValue, testDataId, comparator); 26 parameters.add(parameter); 27 } 28 29 public void addParameter(String testDataId, Object searchedValue) { 30 addParameter(testDataId, searchedValue, new DefaultComparator()); 31 } 32 33 public Iterator<SearchParameter> getIterator() { 34 return parameters.iterator(); 35 } 36 37 } 38