View Javadoc

1   package com.atlassian.user.search.query;
2   
3   import java.util.ArrayList;
4   import java.util.List;
5   
6   public class DefaultQueryContext implements QueryContext
7   {
8       private final ArrayList<String> repositoryKeys = new ArrayList<String>();
9   
10      public void addRepositoryKey(String key) throws IllegalArgumentException
11      {
12          if (repositoryKeys.contains(key) || repositoryKeys.contains(QueryContext.ALL_REPOSITORIES))
13              throw new IllegalArgumentException("Repository key [" + key + " is already listed in this query context.");
14  
15          repositoryKeys.add(key);
16      }
17  
18      public List getRepositoryKeys()
19      {
20          return repositoryKeys;
21      }
22  }