blob: a39f26385fe447ab103c39498770d781c6c86178 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.oodt.cas.catalog.query;
//JDK imports
import java.util.Properties;
/**
* @author bfoster
* @version $Revision$
*
* <p>
* A Configurable QueryExpression
* <p>
*/
public class CustomQueryExpression extends QueryExpression {
protected Properties properties;
protected String name;
public CustomQueryExpression(String name) {
this(name, new Properties());
}
public CustomQueryExpression(String name, Properties properties) {
super();
this.name = name;
if (properties != null)
this.properties = properties;
else
this.properties = new Properties();
}
public String getName() {
return this.name;
}
public void setProperty(String key, String value) {
this.properties.put(key, value);
}
public String getProperty(String key) {
return this.properties.getProperty(key);
}
@Override
public CustomQueryExpression clone() {
CustomQueryExpression cqe = new CustomQueryExpression(this.name, (Properties) this.properties.clone());
cqe.setBucketNames(this.getBucketNames());
return cqe;
}
@Override
public String toString() {
return "({" + this.bucketNames + "} " + this.name + " : " + this.properties.toString() + ")";
}
}