comparison gnv-artifacts/src/main/java/de/intevation/gnv/state/cache/QueryObject.java @ 1119:7c4f81f74c47

merged gnv-artifacts
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 28 Sep 2012 12:14:00 +0200
parents f953c9a559d8
children
comparison
equal deleted inserted replaced
1027:fca4b5eb8d2f 1119:7c4f81f74c47
1 /*
2 * Copyright (c) 2010 by Intevation GmbH
3 *
4 * This program is free software under the LGPL (>=v2.1)
5 * Read the file LGPL.txt coming with the software for details
6 * or visit http://www.gnu.org/licenses/ if it does not exist.
7 */
8
9 package de.intevation.gnv.state.cache;
10 /**
11 * This Class is a Container which carries the
12 * databasequery which belongs to an state.
13 * It is also possible to look up if the query contains a specific
14 * TableName.
15 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
16 *
17 */
18 public class QueryObject {
19
20 /**
21 * The Id of the State the Query belongs to
22 */
23 private String stateId = null;
24
25 /**
26 * The Query which belongs to the State
27 */
28 private String query = null;
29
30 /**
31 * Constructor
32 * @param stateId the Id of the State the Query belongs to
33 * @param query the Query which belongs to the State
34 */
35 public QueryObject(String stateId, String query) {
36 this.stateId = stateId;
37 this.query = query.toUpperCase();
38 }
39
40 /**
41 * Returns the StateId
42 * @return the Stateid
43 */
44 public String getStateId() {
45 return stateId;
46 }
47
48 /**
49 * Returns the Querystring
50 * @return the QueryString
51 */
52 public String getQuery() {
53 return query;
54 }
55
56 /**
57 * Returns true if the given Name of the Table is Contained in the Query
58 * @param tableName the Name of the Table
59 * @return true if the Name of the Table is contained in the Query
60 */
61 public boolean queryContainsTableName(String tableName){
62 return this.query.contains(tableName);
63 }
64 }

http://dive4elements.wald.intevation.org