Skip to content

Commit

Permalink
add convenience function
Browse files Browse the repository at this point in the history
  • Loading branch information
mtf90 committed Aug 26, 2024
1 parent 149aad9 commit ebe3c16
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.io.InputStream;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedHashMap;
Expand Down Expand Up @@ -85,6 +86,18 @@ public class RegisterAutomatonImporter {
public Collection<DataType<?>> getDataTypes() {
return typeMap.values();
}
public <T> Collection<DataType<T>> getDataTypes(Class<T> clazz) {
final Collection<DataType<?>> values = this.typeMap.values();
final List<DataType<T>> result = new ArrayList<>(values.size());

for (DataType<?> value : values) {
if (value.getBase().equals(clazz)) {
result.add((DataType<T>) value);
}
}

return result;
}

public RegisterAutomatonImporter(InputStream is) {
loadModel(is);
Expand Down

0 comments on commit ebe3c16

Please sign in to comment.