Interface MutableAttributeHolder

  • All Superinterfaces:
    AttributeHolder

    public interface MutableAttributeHolder
    extends AttributeHolder
    An interface for types that support mutating attributes.
    Since:
    1.0
    • Method Detail

      • setAttribute

        @NonNull
        default MutableAttributeHolder setAttribute​(@NonNull
                                                    java.lang.CharSequence name,
                                                    @Nullable
                                                    java.lang.Object value)
        Sets an attribute on the message.
        Parameters:
        name - The name of the attribute
        value - The value of the attribute
        Returns:
        This message
      • removeAttribute

        @NonNull
        default <T> java.util.Optional<T> removeAttribute​(@NonNull
                                                          java.lang.CharSequence name,
                                                          @NonNull
                                                          java.lang.Class<T> type)
        Remove an attribute. Returning the old value if it is present.
        Type Parameters:
        T - type Generic
        Parameters:
        name - The name of the attribute
        type - The required type
        Returns:
        An Optional value