public class ModuleDescriptorUtils extends Object
ModuleDescriptors
.Modifier and Type | Method and Description |
---|---|
static <T,M extends com.atlassian.plugin.ModuleDescriptor<T>> |
toModule() |
static <T,M extends com.atlassian.plugin.ModuleDescriptor<T>> |
toModules(Collection<M> descriptors)
|
static <T,M extends com.atlassian.plugin.ModuleDescriptor<T>> |
toModules(Stream<M> descriptors)
|
static <T,M extends BaseWeightedModuleDescriptor<T>> |
toSortedModules(Collection<M> descriptors)
Convert a
Collection of BaseWeightedModuleDescriptor into a Stream of T
(sorted by BaseWeightedModuleDescriptor's weight), where T is the type
returned by ModuleDescriptor.getModule() . |
static <T,M extends BaseWeightedModuleDescriptor<T>> |
toSortedModules(Stream<M> descriptors)
Convert a
Stream of BaseWeightedModuleDescriptor into a Stream of T
(sorted by BaseWeightedModuleDescriptor's weight), where T is the type
returned by ModuleDescriptor.getModule() . |
public static <T,M extends com.atlassian.plugin.ModuleDescriptor<T>> Function<M,T> toModule()
T
- type of moduleM
- type of module descriptorFunction
for picking the result of ModuleDescriptor.getModule()
from a
descriptor.
The cast is safe as a ModuleDescriptor
can only ever return a module of it's generic type.
public static <T,M extends com.atlassian.plugin.ModuleDescriptor<T>> Stream<T> toModules(Collection<M> descriptors)
Iterable
of ModuleDescriptor
into a Stream
of T
, where T is the
type returned by ModuleDescriptor.getModule()
.T
- the type of module returned by the descriptorsM
- the module descriptors' typedescriptors
- the module descriptors to convert.public static <T,M extends com.atlassian.plugin.ModuleDescriptor<T>> Stream<T> toModules(Stream<M> descriptors)
Stream
of ModuleDescriptor
into a Stream
of T
, where T is the
type returned by ModuleDescriptor.getModule()
.T
- the type of module returned by the descriptorsM
- the module descriptors' typedescriptors
- the module descriptors to convert.public static <T,M extends BaseWeightedModuleDescriptor<T>> Stream<T> toSortedModules(Collection<M> descriptors)
Collection
of BaseWeightedModuleDescriptor
into a Stream
of T
(sorted by BaseWeightedModuleDescriptor's
weight), where T is the type
returned by ModuleDescriptor.getModule()
.T
- the type of module returned by the descriptorsM
- the weighted module descriptors' typedescriptors
- the weighted module descriptors to convert.public static <T,M extends BaseWeightedModuleDescriptor<T>> Stream<T> toSortedModules(Stream<M> descriptors)
Stream
of BaseWeightedModuleDescriptor
into a Stream
of T
(sorted by BaseWeightedModuleDescriptor's
weight), where T is the type
returned by ModuleDescriptor.getModule()
.T
- the type of module returned by the descriptorsM
- the weighted module descriptors' typedescriptors
- the weighted module descriptors to convert.Copyright © 2024 Atlassian. All rights reserved.