Class StringArgument
- java.lang.Object
-
- org.firebirdsql.gds.impl.argument.Argument
-
- org.firebirdsql.gds.impl.argument.TypedArgument
-
- org.firebirdsql.gds.impl.argument.StringArgument
-
- All Implemented Interfaces:
java.io.Serializable
,Parameter
public final class StringArgument extends TypedArgument
Argument
implementation for String values- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StringArgument(int type, ArgumentType argumentType, java.lang.String value)
Deprecated.will be removed in Jaybird 6, useStringArgument(int, ArgumentType, String, Encoding)
StringArgument(int type, ArgumentType argumentType, java.lang.String value, Encoding encoding)
-
Method Summary
All Methods Instance Methods Concrete 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.boolean
equals(java.lang.Object other)
int
getLength()
int
getValueAsInt()
The value of the parameter as int.java.lang.String
getValueAsString()
The value of the parameter as String.int
hashCode()
void
writeTo(java.io.OutputStream outputStream)
Writes the arguments to the suppliedOutputStream
in the XDR format of the type.-
Methods inherited from class org.firebirdsql.gds.impl.argument.Argument
getType, getValueAsLong
-
-
-
-
Constructor Detail
-
StringArgument
@Deprecated public StringArgument(int type, ArgumentType argumentType, java.lang.String value)
Deprecated.will be removed in Jaybird 6, useStringArgument(int, ArgumentType, String, Encoding)
-
StringArgument
public StringArgument(int type, ArgumentType argumentType, java.lang.String value, Encoding encoding)
-
-
Method Detail
-
writeTo
public void writeTo(java.io.OutputStream outputStream) throws java.io.IOException
Description copied from class:Argument
Writes the arguments to the suppliedOutputStream
in the XDR format of the type.
-
getLength
public int getLength()
- Specified by:
getLength
in classArgument
- Returns:
- Total length of the buffer item when written to the OutputStream by
Argument.writeTo(java.io.OutputStream)
. This includes the item, the value and other items contributing to the total length (e.g. the length of the value).
-
getValueAsString
public java.lang.String getValueAsString()
Description copied from interface:Parameter
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).
- Specified by:
getValueAsString
in interfaceParameter
- Overrides:
getValueAsString
in classArgument
- Returns:
- The value as string
-
getValueAsInt
public int getValueAsInt()
Description copied from interface:Parameter
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).
- Specified by:
getValueAsInt
in interfaceParameter
- Overrides:
getValueAsInt
in classArgument
- Returns:
- The value as int
-
copyTo
public void copyTo(ParameterBuffer buffer, Encoding stringEncoding)
Description copied from interface:Parameter
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.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
-