|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.query.QueryParameter
public class QueryParameter
Holds information (name, type and value) about a single parameter to a query.
Field Summary | |
---|---|
private Item |
itemType
|
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)
|
Item |
getItemType()
The parameter should be an entity of the given item type. |
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 |
setItemType(Item itemType)
Changes the type of the parameter. |
void |
setType(Type type)
Changes the type of the parameter. |
void |
setValue(Object value)
Change the value of the parameter. |
String |
toString()
|
void |
validateValue()
Validate the parameter value using the type information if it has been provided. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final String name
private final boolean permanent
private Type type
private Item itemType
private Object value
Constructor Detail |
---|
public QueryParameter(String name)
name
- The name of the parameterpublic QueryParameter(String name, boolean permanent, Type type, Object value)
name
- The name of the parameterpermanent
- If the parameter should be permanent or not. A
permanent parameter can't change it's valuetype
- The type of valuevalue
- The valueMethod Detail |
---|
public String getName()
public boolean isPermanent()
public Type getType()
public void setType(Type type)
getItemType()
value to null.
type
- The new typepublic Object getValue()
public void setValue(Object value)
value
- The new valuepublic Item getItemType()
public void setItemType(Item itemType)
getType()
value to null.
itemType
- The new typepublic void validateValue()
Type.isCorrectType(Object)
. If
an item type has been set it is checked that the value is an
instance of the given item type.
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
public String toString()
toString
in class Object
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |