View Javadoc

1   /*
2    * Copyright (C) 2007 ETH Zurich
3    *
4    * This file is part of Fosstrak (www.fosstrak.org).
5    *
6    * Fosstrak is free software; you can redistribute it and/or
7    * modify it under the terms of the GNU Lesser General Public
8    * License version 2.1, as published by the Free Software Foundation.
9    *
10   * Fosstrak is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13   * Lesser General Public License for more details.
14   *
15   * You should have received a copy of the GNU Lesser General Public
16   * License along with Fosstrak; if not, write to the Free
17   * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18   * Boston, MA  02110-1301  USA
19   */
20  
21  package org.fosstrak.epcis.repository.query;
22  
23  import java.util.ArrayList;
24  import java.util.HashMap;
25  import java.util.List;
26  import java.util.Map;
27  
28  /**
29   * TODO: javadoc
30   * 
31   * @author Marco Steybe
32   */
33  public class MasterDataQueryDTO {
34  
35      private int maxElementCount = -1;
36      private boolean includeAttributes = false;
37      private boolean includeChildren = false;
38      private List<String> vocabularyTypes = null;
39      private List<String> vocabularyEqNames = null;
40      private List<String> vocabularyWdNames = null;
41      private List<String> attributeNames = null;
42      private List<String> includedAttributeNames = null;
43      private Map<String, List<String>> attributeNameAndValues = null;
44  
45      public void resetQuery() {
46          maxElementCount = -1;
47          vocabularyTypes = null;
48          vocabularyEqNames = null;
49          vocabularyWdNames = null;
50          attributeNames = null;
51          includedAttributeNames = null;
52          attributeNameAndValues = null;
53      }
54  
55      public void addAttributeName(String attrName) {
56          if (attributeNames == null) {
57              attributeNames = new ArrayList<String>();
58          }
59          attributeNames.add(attrName);
60      }
61  
62      public void addAttributeNameAndValues(String attrName, List<String> attrValues) {
63          if (attributeNameAndValues == null) {
64              attributeNameAndValues = new HashMap<String, List<String>>();
65          }
66          attributeNameAndValues.put(attrName, attrValues);
67      }
68  
69      public void addVocabularyEqName(String vocabularyEqName) {
70          if (vocabularyEqNames == null) {
71              vocabularyEqNames = new ArrayList<String>();
72          }
73          vocabularyEqNames.add(vocabularyEqName);
74      }
75  
76      public void addVocabularyType(String vocabularyType) {
77          if (vocabularyTypes == null) {
78              vocabularyTypes = new ArrayList<String>();
79          }
80          vocabularyTypes.add(vocabularyType);
81      }
82  
83      public void addVocabularyWdName(String vocabularyWdName) {
84          if (vocabularyWdNames == null) {
85              vocabularyWdNames = new ArrayList<String>();
86          }
87          vocabularyWdNames.add(vocabularyWdName);
88      }
89  
90      public Map<String, List<String>> getAttributeNameAndValues() {
91          return attributeNameAndValues;
92      }
93  
94      public List<String> getAttributeNames() {
95          return attributeNames;
96      }
97  
98      public boolean getIncludeAttributes() {
99          return includeAttributes;
100     }
101 
102     public boolean getIncludeChildren() {
103         return includeChildren;
104     }
105 
106     public List<String> getIncludedAttributeNames() {
107         return includedAttributeNames;
108     }
109 
110     public int getMaxElementCount() {
111         return maxElementCount;
112     }
113 
114     public List<String> getVocabularyEqNames() {
115         return vocabularyEqNames;
116     }
117 
118     public List<String> getVocabularyTypes() {
119         return vocabularyTypes;
120     }
121 
122     public List<String> getVocabularyWdNames() {
123         return vocabularyWdNames;
124     }
125 
126     public void setAttributeNameAndValues(Map<String, List<String>> attributeNameAndValues) {
127         this.attributeNameAndValues = attributeNameAndValues;
128     }
129 
130     public void setAttributeNames(List<String> attributeNames) {
131         this.attributeNames = attributeNames;
132     }
133 
134     public void setIncludeAttributes(boolean includeAttributes) {
135         this.includeAttributes = includeAttributes;
136     }
137 
138     public void setIncludeChildren(boolean includeChildren) {
139         this.includeChildren = includeChildren;
140     }
141 
142     public void setIncludedAttributeNames(List<String> includedAttributeNames) {
143         this.includedAttributeNames = includedAttributeNames;
144     }
145 
146     public void setMaxElementCount(int maxElementCount) {
147         this.maxElementCount = maxElementCount;
148     }
149 
150     public void setVocabularyEqNames(List<String> vocabularyEqNames) {
151         this.vocabularyEqNames = vocabularyEqNames;
152     }
153 
154     public void setVocabularyTypes(List<String> vocabularyTypes) {
155         this.vocabularyTypes = vocabularyTypes;
156     }
157 
158     public void setVocabularyWdNames(List<String> vocabularyWdNames) {
159         this.vocabularyWdNames = vocabularyWdNames;
160     }
161 }