Class AbstractDeclarable

    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractDeclarable()  
      AbstractDeclarable​(java.util.Map<java.lang.String,​java.lang.Object> arguments)
      Construct an instance with the supplied arguments, or an empty map if null.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addArgument​(java.lang.String argName, java.lang.Object argValue)
      Add an argument to the declarable.
      java.util.Map<java.lang.String,​java.lang.Object> getArguments()  
      java.util.Collection<?> getDeclaringAdmins()
      The collection of AmqpAdmins that should declare this object; if empty, all admins should declare.
      boolean isIgnoreDeclarationExceptions()
      Should ignore exceptions (such as mismatched args) when declaring.
      java.lang.Object removeArgument​(java.lang.String name)
      Remove an argument from the declarable.
      void setAdminsThatShouldDeclare​(java.lang.Object... adminArgs)
      The AmqpAdmins that should declare this object; default is all admins.
      void setIgnoreDeclarationExceptions​(boolean ignoreDeclarationExceptions)
      Set to true to ignore exceptions such as mismatched properties when declaring.
      void setShouldDeclare​(boolean shouldDeclare)
      Whether or not this object should be automatically declared by any AmqpAdmin.
      boolean shouldDeclare()
      Whether or not this object should be automatically declared by any AmqpAdmin.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractDeclarable

        public AbstractDeclarable()
      • AbstractDeclarable

        public AbstractDeclarable​(@Nullable
                                  java.util.Map<java.lang.String,​java.lang.Object> arguments)
        Construct an instance with the supplied arguments, or an empty map if null.
        Parameters:
        arguments - the arguments.
        Since:
        2.2.2
    • Method Detail

      • shouldDeclare

        public boolean shouldDeclare()
        Description copied from interface: Declarable
        Whether or not this object should be automatically declared by any AmqpAdmin.
        Specified by:
        shouldDeclare in interface Declarable
        Returns:
        true if the object should be declared.
      • setShouldDeclare

        public void setShouldDeclare​(boolean shouldDeclare)
        Whether or not this object should be automatically declared by any AmqpAdmin. Default is true.
        Parameters:
        shouldDeclare - true or false.
      • getDeclaringAdmins

        public java.util.Collection<?> getDeclaringAdmins()
        Description copied from interface: Declarable
        The collection of AmqpAdmins that should declare this object; if empty, all admins should declare.
        Specified by:
        getDeclaringAdmins in interface Declarable
        Returns:
        the collection.
      • isIgnoreDeclarationExceptions

        public boolean isIgnoreDeclarationExceptions()
        Description copied from interface: Declarable
        Should ignore exceptions (such as mismatched args) when declaring.
        Specified by:
        isIgnoreDeclarationExceptions in interface Declarable
        Returns:
        true if should ignore.
      • setIgnoreDeclarationExceptions

        public void setIgnoreDeclarationExceptions​(boolean ignoreDeclarationExceptions)
        Set to true to ignore exceptions such as mismatched properties when declaring.
        Parameters:
        ignoreDeclarationExceptions - the ignoreDeclarationExceptions.
        Since:
        1.6
      • setAdminsThatShouldDeclare

        public void setAdminsThatShouldDeclare​(java.lang.Object... adminArgs)
        Description copied from interface: Declarable
        The AmqpAdmins that should declare this object; default is all admins.

        A null argument, or an array/varArg with a single null argument, clears the collection (setAdminsThatShouldDeclare((AmqpAdmin) null) or setAdminsThatShouldDeclare((AmqpAdmin[]) null)). Clearing the collection resets the behavior such that all admins will declare the object.
        Specified by:
        setAdminsThatShouldDeclare in interface Declarable
        Parameters:
        adminArgs - The admins.
      • addArgument

        public void addArgument​(java.lang.String argName,
                                java.lang.Object argValue)
        Description copied from interface: Declarable
        Add an argument to the declarable.
        Specified by:
        addArgument in interface Declarable
        Parameters:
        argName - the argument name.
        argValue - the argument value.
      • removeArgument

        public java.lang.Object removeArgument​(java.lang.String name)
        Description copied from interface: Declarable
        Remove an argument from the declarable.
        Specified by:
        removeArgument in interface Declarable
        Parameters:
        name - the argument name.
        Returns:
        the argument value or null if not present.
      • getArguments

        public java.util.Map<java.lang.String,​java.lang.Object> getArguments()