Class TtyPortMetricsBuilder

  • All Implemented Interfaces:
    org.refcodes.mixin.ReadTimeoutInMsAccessor, org.refcodes.mixin.WriteTimeoutInMsAccessor, org.refcodes.serial.PortMetrics

    public class TtyPortMetricsBuilder
    extends TtyPortMetrics
    The TtyPortMetricsBuilder enriches the TtyPortMetrics with builder functionality.
    • Constructor Detail

      • TtyPortMetricsBuilder

        public TtyPortMetricsBuilder​(int aBaudRate,
                                     int aDataBits,
                                     StopBits aStopBits,
                                     Parity aParity,
                                     Handshake aHandshake,
                                     int aReadTimeout,
                                     int aWriteTimeout)
        Constructs the PortMetricsAccessor.PortMetricsBuilder instance.
        Parameters:
        aBaudRate - The baud rate to be set.
        aDataBits - The data bits to be set.
        aStopBits - The StopBits to be set.
        aParity - The Parity be set.
        aHandshake - The Handshake be set.
        aReadTimeout - The read timeout to be set.
        aWriteTimeout - The write timeout to be set.
      • TtyPortMetricsBuilder

        public TtyPortMetricsBuilder​(BaudRate aBaudRate,
                                     int aDataBits,
                                     StopBits aStopBits,
                                     Parity aParity,
                                     Handshake aHandshake,
                                     int aReadTimeout,
                                     int aWriteTimeout)
        Constructs the PortMetricsAccessor.PortMetricsBuilder instance.
        Parameters:
        aBaudRate - The BaudRate to be set.
        aDataBits - The data bits to be set.
        aStopBits - The StopBits to be set.
        aParity - The Parity be set.
        aHandshake - The Handshake be set.
        aReadTimeout - The read timeout to be set.
        aWriteTimeout - The write timeout to be set.
      • TtyPortMetricsBuilder

        public TtyPortMetricsBuilder​(int aBaudRate,
                                     int aDataBits,
                                     StopBits aStopBits,
                                     Parity aParity,
                                     Handshake aHandshake)
        Constructs the PortMetricsAccessor.PortMetricsBuilder instance. Timeouts are disabled.
        Parameters:
        aBaudRate - The baud rate to be set.
        aDataBits - The data bits to be set.
        aStopBits - The StopBits to be set.
        aParity - The Parity be set.
        aHandshake - The Handshake be set.
      • TtyPortMetricsBuilder

        public TtyPortMetricsBuilder​(BaudRate aBaudRate,
                                     int aDataBits,
                                     StopBits aStopBits,
                                     Parity aParity,
                                     Handshake aHandshake)
        Constructs the PortMetricsAccessor.PortMetricsBuilder instance. Timeouts are disabled.
        Parameters:
        aBaudRate - The BaudRate to be set.
        aDataBits - The data bits to be set.
        aStopBits - The StopBits to be set.
        aParity - The Parity be set.
        aHandshake - The Handshake be set.
      • TtyPortMetricsBuilder

        public TtyPortMetricsBuilder​(int aBaudRate,
                                     int aDataBits,
                                     StopBits aStopBits,
                                     Parity aParity)
        Constructs the PortMetricsAccessor.PortMetricsBuilder instance. Timeouts are disabled. The underlying system's implementation or other implementation specific handshaking is used (Handshake.AUTO).
        Parameters:
        aBaudRate - The baud rate to be set.
        aDataBits - The data bits to be set.
        aStopBits - The StopBits to be set.
        aParity - The Parity be set.
      • TtyPortMetricsBuilder

        public TtyPortMetricsBuilder​(BaudRate aBaudRate,
                                     int aDataBits,
                                     StopBits aStopBits,
                                     Parity aParity)
        Constructs the PortMetricsAccessor.PortMetricsBuilder instance. Timeouts are disabled. The underlying system's implementation or other implementation specific handshaking is used (Handshake.AUTO).
        Parameters:
        aBaudRate - The BaudRate to be set.
        aDataBits - The data bits to be set.
        aStopBits - The StopBits to be set.
        aParity - The Parity be set.
      • TtyPortMetricsBuilder

        public TtyPortMetricsBuilder​(BaudRate aBaudRate)
        Constructs the PortMetricsAccessor.PortMetricsBuilder instance. Timeouts are disabled. The underlying system's implementation or other implementation specific handshaking, stop bits and parity are used (Handshake.AUTO).
        Parameters:
        aBaudRate - The BaudRate to be set.
      • TtyPortMetricsBuilder

        public TtyPortMetricsBuilder​(int aBaudRate)
        Constructs the PortMetricsAccessor.PortMetricsBuilder instance. Timeouts are disabled. The underlying system's implementation or other implementation specific handshaking, stop bits and parity are used (Handshake.AUTO).
        Parameters:
        aBaudRate - The baud rate to be set.
    • Method Detail

      • setBaudRate

        public void setBaudRate​(int aBaudRate)
        The baud rate of the port.
        Parameters:
        aBaudRate - The port's baud rate.
      • withBaudRate

        public TtyPortMetricsBuilder withBaudRate​(int aBaudRate)
        The baud rate of the port.
        Parameters:
        aBaudRate - The port's baud rate.
        Returns:
        This instance as of the builder pattern.
      • setBaudRate

        public void setBaudRate​(BaudRate aBaudRate)
        The BaudRate of the port.
        Parameters:
        aBaudRate - The port's baud rate.
      • withBaudRate

        public TtyPortMetricsBuilder withBaudRate​(BaudRate aBaudRate)
        The BaudRate of the port.
        Parameters:
        aBaudRate - The port's baud rate.
        Returns:
        This instance as of the builder pattern.
      • setParity

        public void setParity​(Parity aParity)
        The Parity of the port.
        Parameters:
        aParity - The port's parity.
      • withPartiry

        public TtyPortMetricsBuilder withPartiry​(Parity aParity)
        The Parity of the port.
        Parameters:
        aParity - The port's parity.
        Returns:
        This instance as of the builder pattern.
      • setDataBits

        public void setDataBits​(int aDataBits)
        The number of data bits used by the port.
        Parameters:
        aDataBits - The data bits used by the port.
      • withDataBits

        public TtyPortMetricsBuilder withDataBits​(int aDataBits)
        The data bits used by the port.
        Parameters:
        aDataBits - The port's data bits being used.
        Returns:
        This instance as of the builder pattern.
      • setStopBits

        public void setStopBits​(StopBits aStopBits)
        The number of stop bits used by the port.
        Parameters:
        aStopBits - The stop bits used by the port.
      • withStopBits

        public TtyPortMetricsBuilder withStopBits​(StopBits aStopBits)
        The StopBits used by the port.
        Parameters:
        aStopBits - The port's stop bits being used.
        Returns:
        This instance as of the builder pattern.
      • setHandshake

        public void setHandshake​(Handshake aHandshake)
        The kind of Handshake used by the port.
        Parameters:
        aHandshake - The port's handshake being used.
      • withHandshake

        public TtyPortMetricsBuilder withHandshake​(Handshake aHandshake)
        The Handshake used by the port.
        Parameters:
        aHandshake - The port's stop bits being used.
        Returns:
        This instance as of the builder pattern.
      • setReadTimeoutMillis

        public void setReadTimeoutMillis​(int aReadTimeout)
        The read timeout in milliseconds.
        Parameters:
        aReadTimeout - The read timeout.
      • withReadTimeoutMillis

        public TtyPortMetricsBuilder withReadTimeoutMillis​(int aReadTimeout)
        The read timeout used by the port.
        Parameters:
        aReadTimeout - The port's read timeout being used.
        Returns:
        This instance as of the builder pattern.
      • setWriteTimeoutMillis

        public void setWriteTimeoutMillis​(int aWriteTimeout)
        The write timeout in milliseconds.
        Parameters:
        aWriteTimeout - The write timeout.
      • withWriteTimeoutMillis

        public TtyPortMetricsBuilder withWriteTimeoutMillis​(int aWriteTimeout)
        The write timeout used by the port.
        Parameters:
        aWriteTimeout - The port's write timeout being used.
        Returns:
        This instance as of the builder pattern.