mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Reformat.
This commit is contained in:
parent
3bdc83b20e
commit
43b037171c
1 changed files with 2 additions and 9 deletions
|
@ -1,7 +1,6 @@
|
|||
package com.beust.kobalt.internal
|
||||
|
||||
import com.beust.kobalt.api.IProjectAffinity
|
||||
import com.beust.kobalt.api.ISimpleAffinity
|
||||
import com.beust.kobalt.api.KobaltContext
|
||||
import com.beust.kobalt.api.Project
|
||||
|
||||
|
@ -11,19 +10,13 @@ class ActorUtils {
|
|||
* Return the plug-in actor with the highest affinity.
|
||||
*/
|
||||
fun <T : IProjectAffinity> selectAffinityActor(project: Project, context: KobaltContext, actors: List<T>)
|
||||
= actors.maxBy { it.affinity(project, context) }
|
||||
= actors.maxBy { it.affinity(project, context) }
|
||||
|
||||
/**
|
||||
* Return all the plug-in actors with a non zero affinity sorted from the highest to the lowest.
|
||||
*/
|
||||
fun <T : IProjectAffinity> selectAffinityActors(project: Project, context: KobaltContext, actors: List<T>)
|
||||
= actors.filter { it.affinity(project, context) > 0 }
|
||||
.sortedByDescending { it.affinity(project, context) }
|
||||
|
||||
/**
|
||||
* Return the plug-in actor with the highest affinity.
|
||||
*/
|
||||
fun <T : ISimpleAffinity<A>, A> selectAffinityActor(actors: List<T>, arg: A) = actors.maxBy { it.affinity(arg) }
|
||||
.sortedByDescending { it.affinity(project, context) }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue