class Uris {

    @Deprecated
    public static Function<URI, String> parameter( final String name )
    {
        return uri ->
        {
            if ( uri == null )
            {
                return null;
            }

            String query = uri.getQuery();
            if ( query != null )
            {
                for ( String param : query.split( "&" ) )
                {
                    String[] keyValue = param.split( "=" );

                    if ( keyValue[0].equalsIgnoreCase( name ) )
                    {
                        if ( keyValue.length == 2 )
                        {
                            return keyValue[1];
                        }
                        else
                        {
                            return "true";
                        }
                    }
                }
            }
            return null;
        };
    }

    private  Uris();

}