Package org.firebirdsql.gds
Interface Parameter
-
- All Known Implementing Classes:
Argument
,BigIntArgument
,ByteArgument
,ByteArrayArgument
,NumericArgument
,SingleItem
,StringArgument
,TypedArgument
public interface Parameter
Interface for parameters stored in aParameterBuffer
.- Since:
- 3.0
- Author:
- Mark Rotteveel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
copyTo(ParameterBuffer buffer, Encoding stringEncoding)
Copies this argument into the supplied buffer, uses the suppliedEncoding
for string arguments.int
getType()
The type identifier of the parameter (usually one of the constant values inISCConstants
).int
getValueAsInt()
The value of the parameter as int.long
getValueAsLong()
The value of the parameter as long.java.lang.String
getValueAsString()
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 suppliedEncoding
for string arguments.An instance of
Parameter
should know how to copy itself into another buffer (eg an instance ofStringArgument
would 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 ofnull
can be used to signal that the original encoding should be used.
-
-