Class PlccomMqttLastWill.Builder

  • Enclosing class:
    PlccomMqttLastWill

    public static final class PlccomMqttLastWill.Builder
    extends Object
    Builder for immutable Last Will configuration.
    • Method Detail

      • lastWillPayload

        public PlccomMqttLastWill.Builder lastWillPayload​(byte[] value)
        Sets the Last Will payload bytes.
        Parameters:
        value - payload bytes, or null to use an empty payload
        Returns:
        this builder
      • lastWillPayload

        public PlccomMqttLastWill.Builder lastWillPayload​(String value)
        Sets the Last Will payload from text.

        The text is encoded as UTF-8 bytes for MQTT transmission.

        Parameters:
        value - payload text, or null to use an empty payload
        Returns:
        this builder
      • retain

        public PlccomMqttLastWill.Builder retain​(boolean value)
        Sets the Last Will retain flag.
        Parameters:
        value - true to ask the broker to retain the Will
        Returns:
        this builder
      • payloadFormatUtf8

        public PlccomMqttLastWill.Builder payloadFormatUtf8​(Boolean value)
        Sets the MQTT 5 Will Payload Format Indicator property.
        Parameters:
        value - true for UTF-8 character data, false for unspecified binary data, or null to omit the property
        Returns:
        this builder
      • payloadFormatUtf8

        public PlccomMqttLastWill.Builder payloadFormatUtf8()
        Declares the Last Will payload as UTF-8 character data.
        Returns:
        this builder
      • payloadFormatBytes

        public PlccomMqttLastWill.Builder payloadFormatBytes()
        Declares the Last Will payload as unspecified binary data.
        Returns:
        this builder
      • messageExpiryIntervalSeconds

        public PlccomMqttLastWill.Builder messageExpiryIntervalSeconds​(Long value)
        Sets the MQTT 5 Will Message Expiry Interval property.
        Parameters:
        value - expiry interval in seconds, or null to omit the property
        Returns:
        this builder
        Throws:
        IllegalArgumentException - if value is outside the MQTT unsigned 32-bit range
      • willDelayIntervalSeconds

        public PlccomMqttLastWill.Builder willDelayIntervalSeconds​(Long value)
        Sets the MQTT 5 Will Delay Interval property.
        Parameters:
        value - delay interval in seconds, or null to omit the property
        Returns:
        this builder
        Throws:
        IllegalArgumentException - if value is outside the MQTT unsigned 32-bit range
      • contentType

        public PlccomMqttLastWill.Builder contentType​(String value)
        Sets the MQTT 5 Will Content Type property.
        Parameters:
        value - content type, or null to omit the property
        Returns:
        this builder
      • responseTopic

        public PlccomMqttLastWill.Builder responseTopic​(String value)
        Sets the MQTT 5 Will Response Topic property.
        Parameters:
        value - response topic, or null to omit the property
        Returns:
        this builder
      • correlationData

        public PlccomMqttLastWill.Builder correlationData​(byte[] value)
        Sets the MQTT 5 Will Correlation Data property.
        Parameters:
        value - correlation data bytes, or null to omit the property
        Returns:
        this builder