Class ByteArgument
- java.lang.Object
-
- org.firebirdsql.gds.impl.argument.Argument
-
- org.firebirdsql.gds.impl.argument.TypedArgument
-
- org.firebirdsql.gds.impl.argument.ByteArgument
-
- All Implemented Interfaces:
java.io.Serializable,Parameter
public final class ByteArgument extends TypedArgument
Argumentimplementation for byte values.- Since:
- 5
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ByteArgument(int type, ArgumentType argumentType, byte value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyTo(ParameterBuffer buffer, Encoding encoding)Copies this argument into the supplied buffer, uses the suppliedEncodingfor string arguments.booleanequals(java.lang.Object other)intgetLength()intgetValueAsInt()The value of the parameter as int.longgetValueAsLong()The value of the parameter as long.inthashCode()voidwriteTo(java.io.OutputStream outputStream)Writes the arguments to the suppliedOutputStreamin the XDR format of the type.-
Methods inherited from class org.firebirdsql.gds.impl.argument.Argument
getType, getValueAsString
-
-
-
-
Constructor Detail
-
ByteArgument
public ByteArgument(int type, ArgumentType argumentType, byte value)
-
-
Method Detail
-
writeTo
public void writeTo(java.io.OutputStream outputStream) throws java.io.IOExceptionDescription copied from class:ArgumentWrites the arguments to the suppliedOutputStreamin the XDR format of the type.
-
getLength
public int getLength()
- Specified by:
getLengthin 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).
-
getValueAsInt
public int getValueAsInt()
Description copied from interface:ParameterThe 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:
getValueAsIntin interfaceParameter- Overrides:
getValueAsIntin classArgument- Returns:
- The value as int
-
getValueAsLong
public long getValueAsLong()
Description copied from interface:ParameterThe 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).
- Specified by:
getValueAsLongin interfaceParameter- Overrides:
getValueAsLongin classArgument- Returns:
- The value as long
-
copyTo
public void copyTo(ParameterBuffer buffer, Encoding encoding)
Description copied from interface:ParameterCopies 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 instanceencoding- Encoding to use for string properties. A value ofnullcan be used to signal that the original encoding should be used.
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-