Enum RetainHandling

java.lang.Object
java.lang.Enum<RetainHandling>
com.hivemq.extension.sdk.api.packets.subscribe.RetainHandling
All Implemented Interfaces:
Serializable, Comparable<RetainHandling>, Constable

public enum RetainHandling
extends Enum<RetainHandling>
The retain handling of a subscription.
Since:
4.0.0, CE 2019.1
  • Enum Constant Details

    • SEND

      public static final RetainHandling SEND
      Send every retained message for any subscription.
      Since:
      4.0.0, CE 2019.1
    • SEND_IF_NEW_SUBSCRIPTION

      public static final RetainHandling SEND_IF_NEW_SUBSCRIPTION
      Send every retained message for new subscriptions only.
      Since:
      4.0.0, CE 2019.1
    • DO_NOT_SEND

      public static final RetainHandling DO_NOT_SEND
      Never send a retained message for the subscription.
      Since:
      4.0.0, CE 2019.1
  • Method Details

    • values

      public static RetainHandling[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static RetainHandling valueOf​(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getCode

      public int getCode()
      Get the retain handling as integer.
      Returns:
      The retain handling.
      Since:
      4.0.0, CE 2019.1
    • fromCode

      @Nullable public static @Nullable RetainHandling fromCode​(int code)
      Returns the Retain Handling belonging to the given byte code.
      Parameters:
      code - The byte code.
      Returns:
      The Retain Handling belonging to the byte code or null if the byte code is not a valid Retain Handling.
      Since:
      4.0.0, CE 2019.1