}
// TODO make these filter set functions use generics
private EC2GroupFilterSet toGroupFilterSet( FilterSetType fst )
{
EC2GroupFilterSet gfs = new EC2GroupFilterSet();
FilterType[] items = fst.getItem();
if (null != items)
{
// -> each filter can have one or more values associated with it
for( int j=0; j < items.length; j++ )
{
EC2Filter oneFilter = new EC2Filter();
String filterName = items[j].getName();
oneFilter.setName( filterName );
ValueSetType vst = items[j].getValueSet();
ValueType[] valueItems = vst.getItem();
for( int k=0; k < valueItems.length; k++ )
{
oneFilter.addValueEncoded( valueItems[k].getValue());
}
gfs.addFilter( oneFilter );
}
}
return gfs;
}