2.14.1: 2009-11-05

net.sf.basedb.core.query
Class QueryParameter

java.lang.Object
  extended by net.sf.basedb.core.query.QueryParameter

public class QueryParameter
extends Object

Holds information (name, type and value) about a single parameter to a query.

Version:
2.9
Author:
Nicklas
Last modified
$Date: 2008-10-24 13:43:13 +0200 (Fri, 24 Oct 2008) $

Field Summary
private  String name
           
private  boolean permanent
           
private  Type type
           
private  Object value
           
 
Constructor Summary
QueryParameter(String name)
          Create a new empty non-permanent query parameter.
QueryParameter(String name, boolean permanent, Type type, Object value)
          Create a new query parameter.
 
Method Summary
 boolean equals(Object o)
           
 String getName()
          Get the name of the parameter.
 Type getType()
          Get the type of the parameter.
 Object getValue()
          Get the value of the parameter.
 int hashCode()
           
 boolean isPermanent()
          Check if the parameter is a permanent parameter.
 void setType(Type type)
          Changes the type of the parameter.
 void setValue(Object value)
          Change the value of the parameter.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private final String name

permanent

private final boolean permanent

type

private Type type

value

private Object value
Constructor Detail

QueryParameter

public QueryParameter(String name)
Create a new empty non-permanent query parameter.

Parameters:
name - The name of the parameter

QueryParameter

public QueryParameter(String name,
                      boolean permanent,
                      Type type,
                      Object value)
Create a new query parameter.

Parameters:
name - The name of the parameter
permanent - If the parameter should be permanent or not. A permanent parameter can't change it's value
type - The type of value
value - The value
Method Detail

getName

public String getName()
Get the name of the parameter.


isPermanent

public boolean isPermanent()
Check if the parameter is a permanent parameter. A permanent paramer can't be changed.


getType

public Type getType()
Get the type of the parameter.


setType

public void setType(Type type)
Changes the type of the parameter. Ignored if the parameter is permanent.

Parameters:
type - The new type

getValue

public Object getValue()
Get the value of the parameter.


setValue

public void setValue(Object value)
Change the value of the parameter. Ignored if the parameter is permanent.

Parameters:
value - The new value

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

2.14.1: 2009-11-05