Package com.xwiki.macros.script
Class ContributorsScriptService
java.lang.Object
com.xwiki.macros.script.ContributorsScriptService
- All Implemented Interfaces:
org.xwiki.script.service.ScriptService
@Component
@Named("contributors")
@Singleton
@Unstable
public class ContributorsScriptService
extends Object
implements org.xwiki.script.service.ScriptService
Tools to manipulate the data needed for the contributors macro.
- Since:
- 1.27.4
- Version:
- $Id$
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsortContributors(Collection<Map<String, Object>> contributors, String key, boolean reverse, int limit) Sort the list of contributors by the given key.
-
Constructor Details
-
ContributorsScriptService
public ContributorsScriptService()
-
-
Method Details
-
sortContributors
public List<Map<String,Object>> sortContributors(Collection<Map<String, Object>> contributors, String key, boolean reverse, int limit) Sort the list of contributors by the given key.- Parameters:
contributors- list of contributorskey- which key to use when sortingreverse- if the list should be reversedlimit- how many elements the list should have after sorting, if the parameter is missing the full list is returned- Returns:
- list of sorted contributors
-