Package org.silverpeas.core.web.util
Class SimpleContributionUIEntity<C extends Contribution>
- java.lang.Object
-
- org.silverpeas.core.web.util.SelectableUIEntity<C>
-
- org.silverpeas.core.web.util.SimpleContributionUIEntity<C>
-
- Type Parameters:
C
- the type of theContribution
.
public class SimpleContributionUIEntity<C extends Contribution> extends SelectableUIEntity<C>
Extension ofSelectableUIEntity
which handles simple cases ofContribution
UI selection.
Of course, if some stuffs are missing into this implementation, it is highly recommended to extend this class.- Author:
- silveryocha
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SimpleContributionUIEntity(C data, Set<String> selectedIds)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <D extends Contribution,W extends SimpleContributionUIEntity<D>>
Wconvert(D contribution, Set<String> selectedIds)
Initializes an item from the givenContribution
and a list of selected ids as string.static <D extends Contribution,W extends SimpleContributionUIEntity<D>>
SilverpeasList<W>convertList(List<D> contributionList, Set<String> selectedIds)
Converts the given data list into aSilverpeasList
of item wrapping theContribution
.String
getId()
Gets the unique identifier of te item into the UI list.-
Methods inherited from class org.silverpeas.core.web.util.SelectableUIEntity
convert, getData, getUserByIdFromCache, isSelected, setSelected
-
-
-
-
Method Detail
-
convert
public static <D extends Contribution,W extends SimpleContributionUIEntity<D>> W convert(D contribution, Set<String> selectedIds)
Initializes an item from the givenContribution
and a list of selected ids as string.- Type Parameters:
D
- the type of theContribution
.W
- the type of the itemContribution
wrapper.- Parameters:
contribution
- the contribution instance.selectedIds
- the selected identifiers.- Returns:
- the initialized item data wrapper.
-
convertList
public static <D extends Contribution,W extends SimpleContributionUIEntity<D>> SilverpeasList<W> convertList(List<D> contributionList, Set<String> selectedIds)
Converts the given data list into aSilverpeasList
of item wrapping theContribution
.- Type Parameters:
D
- the type of theContribution
.W
- the type of the itemContribution
wrapper.- Parameters:
contributionList
- the list ofContribution
.- Returns:
- the
SilverpeasList
of wrapped data item.
-
getId
public String getId()
Description copied from class:SelectableUIEntity
Gets the unique identifier of te item into the UI list.- Specified by:
getId
in classSelectableUIEntity<C extends Contribution>
- Returns:
- a unique identifier as string.
-
-