Class Parameter<T>

    • Field Detail

      • NULL_PARAMETER

        public static final Parameter<?> NULL_PARAMETER
      • codec

        protected final Codec<T> codec
      • value

        protected final T value
      • length

        protected final java.lang.Long length
    • Constructor Detail

      • Parameter

        public Parameter​(Codec<T> codec,
                         T value)
      • Parameter

        public Parameter​(Codec<T> codec,
                         T value,
                         java.lang.Long length)
    • Method Detail

      • encodeText

        public void encodeText​(Writer encoder,
                               Context context)
                        throws java.io.IOException,
                               java.sql.SQLException
        Description copied from interface: Parameter
        Encode parameter in text format
        Specified by:
        encodeText in interface Parameter
        Parameters:
        encoder - packet writer
        context - connection context
        Throws:
        java.io.IOException - if socket error occurs
        java.sql.SQLException - if other kind of error occurs
      • encodeBinary

        public void encodeBinary​(Writer encoder,
                                 Context context)
                          throws java.io.IOException,
                                 java.sql.SQLException
        Description copied from interface: Parameter
        Encode parameter in binary format
        Specified by:
        encodeBinary in interface Parameter
        Parameters:
        encoder - packet writer
        context - connection context
        Throws:
        java.io.IOException - if socket error occurs
        java.sql.SQLException - if other kind of error occurs
      • encodeLongData

        public void encodeLongData​(Writer encoder)
                            throws java.io.IOException,
                                   java.sql.SQLException
        Description copied from interface: Parameter
        Encode parameter in binary long format
        Specified by:
        encodeLongData in interface Parameter
        Parameters:
        encoder - packet writer
        Throws:
        java.io.IOException - if socket error occurs
        java.sql.SQLException - if other kind of error occurs
      • encodeData

        public byte[] encodeData()
                          throws java.io.IOException,
                                 java.sql.SQLException
        Description copied from interface: Parameter
        transform parameter in byte array
        Specified by:
        encodeData in interface Parameter
        Returns:
        bytes
        Throws:
        java.io.IOException - if socket error occurs
        java.sql.SQLException - if other kind of error occurs
      • canEncodeLongData

        public boolean canEncodeLongData()
        Description copied from interface: Parameter
        Can parameter be encoded in binary long format
        Specified by:
        canEncodeLongData in interface Parameter
        Returns:
        can parameter be encoded in binary long format
      • getBinaryEncodeType

        public int getBinaryEncodeType()
        Description copied from interface: Parameter
        return binary encoding type
        Specified by:
        getBinaryEncodeType in interface Parameter
        Returns:
        binary encoding type
      • isNull

        public boolean isNull()
        Description copied from interface: Parameter
        is parameter null
        Specified by:
        isNull in interface Parameter
        Returns:
        is null
      • bestEffortStringValue

        public java.lang.String bestEffortStringValue​(Context context)
        Description copied from interface: Parameter
        Methods to return parameter as string if possible (Streaming parameter will return null)
        Specified by:
        bestEffortStringValue in interface Parameter
        Parameters:
        context - current connection context
        Returns:
        null if not available.