Bug 318765 - [api] Consolidate getSortedVersions() method with getVersions() method family
Summary: [api] Consolidate getSortedVersions() method with getVersions() method family
Status: RESOLVED FIXED
Alias: None
Product: WTP Common Tools
Classification: WebTools
Component: Faceted Project Framework (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Konstantin Komissarchik CLA
QA Contact: Konstantin Komissarchik CLA
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2010-07-02 17:39 EDT by Konstantin Komissarchik CLA
Modified: 2012-01-03 14:32 EST (History)
0 users

See Also:


Attachments
Patch (19.04 KB, patch)
2010-07-02 18:30 EDT, Konstantin Komissarchik CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Komissarchik CLA 2010-07-02 17:39:16 EDT
IProjectFacet and IRuntimeComponent have the following methods:

getVersions() -> Set
getVersions( String filter ) -> Set
getSortedVersions( boolean direction ) -> List

The geSortedVersions method in particular isn't well integrated. Sorting would be better as a feature of the getVersions() method. The return type is problematic too. Better semantics would be conveyed by using SortedSet rather than a List in this situation.

A new enum (SortDirection) will be introduced with three items: NONE, ASCENDING and DESCENDING. A new variant of getVersions() method would be added with the following signature:

getVersions( String filter, SortDirection sortDirection ) -> Set

If sortDirection is not null and is not NONE, the returned set will be castable to SortedSet.

The existing getSortedVersions() method will be removed.
Comment 1 Konstantin Komissarchik CLA 2010-07-02 17:54:58 EDT
In the description, IRuntimeComponentType should be used instead of IRuntimeComponent.
Comment 2 Konstantin Komissarchik CLA 2010-07-02 18:30:11 EDT
Created attachment 173332 [details]
Patch
Comment 3 Konstantin Komissarchik CLA 2010-07-02 18:51:28 EDT
Patch released.