Class ComponentBag.ImmutableComponentBag

    • Constructor Detail

      • ImmutableComponentBag

        ImmutableComponentBag​(ComponentBag original)
    • Method Detail

      • register

        public boolean register​(java.lang.Class<?> componentClass,
                                Inflector<ContractProvider.Builder,​ContractProvider> modelEnhancer)
        Description copied from class: ComponentBag
        Register a component class using a given registration strategy.
        Overrides:
        register in class ComponentBag
        Parameters:
        componentClass - class to be introspected as a contract provider and registered, based on the registration strategy decision.
        modelEnhancer - custom contract provider model enhancer.
        Returns:
        true if the component registration was successful.
      • register

        public boolean register​(java.lang.Class<?> componentClass,
                                int priority,
                                Inflector<ContractProvider.Builder,​ContractProvider> modelEnhancer)
        Description copied from class: ComponentBag
        Register a component class as a contract provider with an explicitly specified binding priority.
        Overrides:
        register in class ComponentBag
        Parameters:
        componentClass - class to be introspected as a contract provider and registered.
        priority - explicitly specified binding priority for the provider contracts implemented by the component.
        modelEnhancer - custom contract provider model enhancer.
        Returns:
        true if the component registration was successful.
      • register

        public boolean register​(java.lang.Class<?> componentClass,
                                java.util.Set<java.lang.Class<?>> contracts,
                                Inflector<ContractProvider.Builder,​ContractProvider> modelEnhancer)
        Description copied from class: ComponentBag
        Register a component class as a contract provider for the specified contracts.
        Overrides:
        register in class ComponentBag
        Parameters:
        componentClass - class to be introspected as a contract provider and registered.
        contracts - contracts to bind the component class to.
        modelEnhancer - custom contract provider model enhancer.
        Returns:
        true if the component registration was successful.
      • register

        public boolean register​(java.lang.Class<?> componentClass,
                                java.util.Map<java.lang.Class<?>,​java.lang.Integer> contracts,
                                Inflector<ContractProvider.Builder,​ContractProvider> modelEnhancer)
        Description copied from class: ComponentBag
        Register a component class as a contract provider for the specified contracts.
        Overrides:
        register in class ComponentBag
        Parameters:
        componentClass - class to be introspected as a contract provider and registered.
        contracts - contracts with their priorities to bind the component class to.
        modelEnhancer - custom contract provider model enhancer.
        Returns:
        true if the component registration was successful.
      • register

        public boolean register​(java.lang.Object component,
                                Inflector<ContractProvider.Builder,​ContractProvider> modelEnhancer)
        Description copied from class: ComponentBag
        Register a component using a given registration strategy.
        Overrides:
        register in class ComponentBag
        Parameters:
        component - instance to be introspected as a contract provider and registered, based on the registration strategy decision.
        modelEnhancer - custom contract provider model enhancer.
        Returns:
        true if the component registration was successful.
      • register

        public boolean register​(java.lang.Object component,
                                int priority,
                                Inflector<ContractProvider.Builder,​ContractProvider> modelEnhancer)
        Description copied from class: ComponentBag
        Register a component as a contract provider with an explicitly specified binding priority.
        Overrides:
        register in class ComponentBag
        Parameters:
        component - instance to be introspected as a contract provider and registered, based on the registration strategy decision.
        priority - explicitly specified binding priority for the provider contracts implemented by the component.
        modelEnhancer - custom contract provider model enhancer.
        Returns:
        true if the component registration was successful.
      • register

        public boolean register​(java.lang.Object component,
                                java.util.Set<java.lang.Class<?>> contracts,
                                Inflector<ContractProvider.Builder,​ContractProvider> modelEnhancer)
        Description copied from class: ComponentBag
        Register a component as a contract provider for the specified contracts.
        Overrides:
        register in class ComponentBag
        Parameters:
        component - instance to be introspected as a contract provider and registered, based on the registration strategy decision.
        contracts - contracts to bind the component to.
        modelEnhancer - custom contract provider model enhancer.
        Returns:
        true if the component registration was successful.
      • register

        public boolean register​(java.lang.Object component,
                                java.util.Map<java.lang.Class<?>,​java.lang.Integer> contracts,
                                Inflector<ContractProvider.Builder,​ContractProvider> modelEnhancer)
        Description copied from class: ComponentBag
        Register a component as a contract provider for the specified contracts.
        Overrides:
        register in class ComponentBag
        Parameters:
        component - instance to be introspected as a contract provider and registered, based on the registration strategy decision.
        contracts - contracts with their priorities to bind the component to.
        modelEnhancer - custom contract provider model enhancer.
        Returns:
        true if the component registration was successful.
      • clear

        public void clear()
        Description copied from class: ComponentBag
        Removes all the component registrations and resets the component bag instance to a state as if it was create anew.
        Overrides:
        clear in class ComponentBag