this.factory = factory;
}
public Collection<Integer> getSelectedContextPartitionPathIds(ContextPartitionSelector contextPartitionSelector) {
if (contextPartitionSelector instanceof ContextPartitionSelectorHash) {
ContextPartitionSelectorHash hash = (ContextPartitionSelectorHash) contextPartitionSelector;
if (hash.getHashes() == null || hash.getHashes().isEmpty()) {
return Collections.emptyList();
}
if (hash.getHashes().size() == 1) {
return Collections.singleton(hash.getHashes().iterator().next());
}
return new ArrayList<Integer>(hash.getHashes());
}
if (contextPartitionSelector instanceof ContextPartitionSelectorFiltered) {
ContextPartitionSelectorFiltered filter = (ContextPartitionSelectorFiltered) contextPartitionSelector;
ContextPartitionIdentifierHash identifierHash = new ContextPartitionIdentifierHash();
List<Integer> accepted = new ArrayList<Integer>();