Hi,

is it necessary to use the legacy datatype array? I think never the Series deals with arrays. What about returning Series<String>?

best regards
  Stephan

Jerome Louvel schrieb:
Hi Paul,

You can to this with: subList(name).toArray(). Is that sufficient?

Maybe we could also add a toArray(String name) or subArray(String name)
shortcut method?

Best regards,
Jerome
-----Message d'origine-----
De : Paul J. Lucas [mailto:[EMAIL PROTECTED] Envoyé : jeudi 20 mars 2008 16:27
À : discuss@restlet.tigris.org
Objet : Series.getValues()

Sorry if this is a duplicate, but I never say my original message echo to the list.

Begin forwarded message:
Date: March 19, 2008 4:19:32 PM PDT
To: discuss@restlet.tigris.org
Subject: Series.getValues()

This method, as written in Restlet 1.0.8, specifically this variant:

        getValues(String name, String separator, boolean ignoreCase)

has room for improvement. Aside from the fact that the ignoreCase parameter is not used, globbing the values together with a separator is not that useful. I really want:

        String[] getValues(String name)

with an implementation like:

    public String[] getFormValues( String paramName ) {
        final List<String> temp = new LinkedList<String>();
        for ( Parameter param : this )
            if ( param.getName().equalsIgnoreCase( paramName ) )
                temp.add( param.getValue() );
        return temp.toArray( new String[ temp.size() ] );
    }

- Paul


Reply via email to