Class NoopDependencyManager

  • All Implemented Interfaces:
    org.eclipse.aether.collection.DependencyManager

    public final class NoopDependencyManager
    extends java.lang.Object
    implements org.eclipse.aether.collection.DependencyManager
    A dependency manager that performs no dependency management operations.

    Overview

    This is a null-object implementation of DependencyManager that effectively disables all dependency management. It always returns null for management operations and returns itself for child manager derivation, making it a true no-op implementation.

    When to Use

    • Testing: When you want to disable dependency management for tests
    • Simple Resolution: When you want pure dependency resolution without management
    • Performance: When dependency management overhead is not needed
    • Legacy Systems: When working with systems that handle management externally

    Thread Safety

    This implementation is completely thread-safe and stateless. The INSTANCE can be safely shared across multiple threads and throughout the entire application lifecycle.

    Comparison with Other Managers

    See Also:
    ClassicDependencyManager, TransitiveDependencyManager, DefaultDependencyManager
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.eclipse.aether.collection.DependencyManager INSTANCE
      A ready-made singleton instance of this dependency manager.
    • Constructor Summary

      Constructors 
      Constructor Description
      NoopDependencyManager()
      Creates a new instance of this dependency manager.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.eclipse.aether.collection.DependencyManager deriveChildManager​(org.eclipse.aether.collection.DependencyCollectionContext context)
      Returns this same instance as the child manager (no-op behavior).
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      org.eclipse.aether.collection.DependencyManagement manageDependency​(org.eclipse.aether.graph.Dependency dependency)
      Returns null, indicating no dependency management should be applied.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • INSTANCE

        public static final org.eclipse.aether.collection.DependencyManager INSTANCE
        A ready-made singleton instance of this dependency manager.

        This instance can be safely reused throughout an entire application regardless of multi-threading, as this implementation is completely stateless and thread-safe. Using this instance is preferred over creating new instances for performance reasons.

    • Constructor Detail

      • NoopDependencyManager

        public NoopDependencyManager()
        Creates a new instance of this dependency manager.

        Note: Usually, INSTANCE should be used instead of creating new instances, as this implementation is stateless and the singleton provides better performance characteristics.

    • Method Detail

      • deriveChildManager

        public org.eclipse.aether.collection.DependencyManager deriveChildManager​(org.eclipse.aether.collection.DependencyCollectionContext context)
        Returns this same instance as the child manager (no-op behavior).
        Specified by:
        deriveChildManager in interface org.eclipse.aether.collection.DependencyManager
        Parameters:
        context - the dependency collection context (validated but not used)
        Returns:
        this same instance
        Throws:
        java.lang.NullPointerException - if context is null
      • manageDependency

        public org.eclipse.aether.collection.DependencyManagement manageDependency​(org.eclipse.aether.graph.Dependency dependency)
        Returns null, indicating no dependency management should be applied.
        Specified by:
        manageDependency in interface org.eclipse.aether.collection.DependencyManager
        Parameters:
        dependency - the dependency to manage (validated but not used)
        Returns:
        null (no management)
        Throws:
        java.lang.NullPointerException - if dependency is null
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object