Added alternative query arguments for listForTypes which takes a list instead of array.
This commit is contained in:
parent
6c67c2266a
commit
a1f07531fa
@ -23,6 +23,8 @@ public interface ComponentPresetDao {
|
||||
public List<ComponentPreset> listForType( ComponentPreset.Type type, boolean favorite );
|
||||
|
||||
public List<ComponentPreset> listForTypes( ComponentPreset.Type ... type );
|
||||
|
||||
public List<ComponentPreset> listForTypes( List<ComponentPreset.Type> types );
|
||||
|
||||
public void setFavorite( ComponentPreset preset, boolean favorite );
|
||||
|
||||
|
@ -124,7 +124,7 @@ public class ComponentPresetDatabase extends Database<ComponentPreset> implement
|
||||
for( ComponentPreset preset : list ) {
|
||||
ComponentPreset.Type presetType = preset.get(ComponentPreset.TYPE);
|
||||
typeLoop: for( int i=0; i<type.length; i++ ) {
|
||||
if ( !presetType.equals(type) ) {
|
||||
if ( presetType.equals(type[i]) ) {
|
||||
result.add(preset);
|
||||
break typeLoop; // from inner loop.
|
||||
}
|
||||
@ -134,6 +134,11 @@ public class ComponentPresetDatabase extends Database<ComponentPreset> implement
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ComponentPreset> listForTypes( List<ComponentPreset.Type> types ) {
|
||||
return listForTypes( (ComponentPreset.Type[]) types.toArray() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ComponentPreset> find(String manufacturer, String partNo) {
|
||||
List<ComponentPreset> presets = new ArrayList<ComponentPreset>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user