Package org.firebirdsql.gds
Interface Parameter
-
- All Known Implementing Classes:
Argument,BigIntArgument,ByteArrayArgument,NumericArgument,SingleItem,StringArgument
public interface ParameterInterface for parameters stored in aParameterBuffer.- Since:
- 3.0
- Author:
- Mark Rotteveel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcopyTo(ParameterBuffer buffer, Encoding stringEncoding)Copies this argument into the supplied buffer, uses the suppliedEncodingfor string arguments.intgetType()The type identifier of the parameter (usually one of the constant values inISCConstants).intgetValueAsInt()The value of the parameter as int.longgetValueAsLong()The value of the parameter as long.java.lang.StringgetValueAsString()The value of the parameter as String.
-
-
-
Method Detail
-
getType
int getType()
The type identifier of the parameter (usually one of the constant values inISCConstants).- Returns:
- The type of the parameter
-
getValueAsString
java.lang.String getValueAsString()
The value of the parameter as String.The implementation may throw a RuntimeException if the parameter isn't a string (or shouldn't be used as a string).
- Returns:
- The value as string
-
getValueAsInt
int getValueAsInt()
The value of the parameter as int.The implementation may throw a RuntimeException if the parameter isn't an int (or shouldn't be used as an int).
- Returns:
- The value as int
-
getValueAsLong
long getValueAsLong()
The value of the parameter as long.The implementation may throw a RuntimeException if the parameter isn't a long (or shouldn't be used as a long).
- Returns:
- The value as long
-
copyTo
void copyTo(ParameterBuffer buffer, Encoding stringEncoding)
Copies this argument into the supplied buffer, uses the suppliedEncodingfor string arguments.An instance of
Parametershould know how to copy itself into another buffer (eg an instance ofStringArgumentwould know to callParameterBuffer.addArgument(int, String, Encoding)).The parameter does not need to check if it is the right type of destination buffer (if someone tries to add a TPB argument to a DPB he is free to try that).
- Parameters:
buffer- ParameterBuffer instancestringEncoding- Encoding to use for string properties. A value ofnullcan be used to signal that the original encoding should be used.
-
-