commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Updated: (COLLECTIONS-286) New util method: CollectionUtils.getSingleton(List<T> singletonList) which returns the single object in the list or throws an exception
Date Sat, 15 Mar 2008 22:28:39 GMT

     [ https://issues.apache.org/jira/browse/COLLECTIONS-286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Henri Yandell updated COLLECTIONS-286:
--------------------------------------

      Description: 
    public <T> T getSingleton(List<T> singletonList)
    {
        if (singletonList.size() != 1)
        {
            throw new IllegalArgumentException("The singletonList size ("
                    + singletonList.size() + ") should be 1.");
        }
        return singletonList.get(0);
    }

  was:

    public <T> T getSingleton(List<T> singletonList)
    {
        if (singletonList.size() != 1)
        {
            throw new IllegalArgumentException("The singletonList size ("
                    + singletonList.size() + ") should be 1.");
        }
        return singletonList.get(0);
    }

    Fix Version/s:     (was: 3.3)
                   Generics

> New util method: CollectionUtils.getSingleton(List<T> singletonList) which returns
the single object in the list or throws an exception
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-286
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-286
>             Project: Commons Collections
>          Issue Type: New Feature
>            Reporter: Geoffrey De Smet
>             Fix For: Generics
>
>
>     public <T> T getSingleton(List<T> singletonList)
>     {
>         if (singletonList.size() != 1)
>         {
>             throw new IllegalArgumentException("The singletonList size ("
>                     + singletonList.size() + ") should be 1.");
>         }
>         return singletonList.get(0);
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message