Class PrioritizedComponents<T>

java.lang.Object
org.eclipse.aether.internal.impl.PrioritizedComponents<T>
Type Parameters:
T - The component type.

public final class PrioritizedComponents<T> extends Object
Helps to sort pluggable components by their priority.
  • Method Details

    • reuseOrCreate

      public static <C> PrioritizedComponents<C> reuseOrCreate(org.eclipse.aether.RepositorySystemSession session, Class<C> discriminator, Map<String,C> components, Function<C,Float> priorityFunction)
      Reuses or creates and caches (if session is equipped with cache, and it does not contain it yet) prioritized components under certain key into session cache. Same session is used to configure prioritized components, so priority sorted components during session are immutable and reusable (if components component map is unchanged).

      The components are expected to be Sisu injected Map-like dynamic component maps. There is a simple "change detection" in place, as injected maps are dynamic, they are atomically expanded or contracted as components are dynamically discovered or unloaded.

      Since:
      2.0.0
    • add

      public void add(T component, float priority)
    • isEmpty

      public boolean isEmpty()
    • getAll

    • getEnabled

    • list

      public void list(StringBuilder buffer)
    • toString

      public String toString()
      Overrides:
      toString in class Object