ingo@1115: /* ingo@1115: * Copyright (c) 2010 by Intevation GmbH ingo@1115: * ingo@1115: * This program is free software under the LGPL (>=v2.1) ingo@1115: * Read the file LGPL.txt coming with the software for details ingo@1115: * or visit http://www.gnu.org/licenses/ if it does not exist. ingo@1115: */ ingo@1115: tim@335: package de.intevation.gnv.state; tim@335: tim@335: /** ingo@796: * The default implementation of InputValue. InputValue objects are ingo@796: * used to store meta information about InputData objects. sascha@803: * sascha@780: * @author Tim Englich tim@335: */ tim@335: public class DefaultInputValue implements InputValue { tim@335: tim@335: /** tim@335: * The UID of this Class. tim@335: */ tim@335: private static final long serialVersionUID = -8518824299166180986L; tim@335: private String name = null; tim@335: private String type = null; tim@335: private boolean multiselect = false; tim@335: private int usedInQueries = 1; tim@335: private String defaultValue = "N/N"; tim@335: ingo@815: tim@335: public DefaultInputValue(String name, String type, String defaultValue, tim@335: boolean multiselect) { tim@335: this(name, type, multiselect, 1); tim@335: this.defaultValue = defaultValue; tim@335: tim@335: } tim@335: ingo@815: tim@335: public DefaultInputValue(String name, String type, boolean multiselect, tim@335: int usedInQueries) { tim@335: this.name = name; tim@335: this.type = type; tim@335: this.multiselect = multiselect; tim@335: this.usedInQueries = usedInQueries; tim@335: } tim@335: ingo@815: tim@335: public String getName() { tim@335: return this.name; tim@335: } tim@335: ingo@815: tim@335: public String getType() { tim@335: return this.type; tim@335: } tim@335: tim@335: /** ingo@796: * Returns the information as string. sascha@803: * ingo@796: * @return information as string. tim@335: */ tim@335: @Override tim@335: public String toString() { tim@335: return "InputValue " + this.name + " ==> " + this.type tim@335: + "==> multiselect: " + this.multiselect; tim@335: } tim@335: ingo@815: tim@335: public boolean isMultiselect() { tim@335: return this.multiselect; tim@335: } tim@335: ingo@815: tim@335: public int usedInQueries() { tim@335: return this.usedInQueries; tim@335: } tim@335: ingo@815: tim@335: public String getDefaultValue() { tim@335: return this.defaultValue; tim@335: } tim@335: tim@335: } sascha@836: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :