juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Bognar (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JUNEAU-49) Support beans as arguments for GET calls using @RemoteableMethod
Date Tue, 30 May 2017 14:28:04 GMT

    [ https://issues.apache.org/jira/browse/JUNEAU-49?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16029480#comment-16029480

James Bognar commented on JUNEAU-49:

My recommendation is to leave the StringUtils.isEmpty() method as-is since it's used in lots
of places and is optimized to work with Strings (the most common case).  instanceof operations
are somewhat expensive and this is a heavily-invoked piece of code.

My recommendation is to add a method to ObjectUtils for this case...
	public static final boolean isEmpty(Object o) {
		if (o == null)
			return true;
		if (o instanceof Collection)
			return ((Collection)o).isEmpty();
		if (o.getClass().isArray())
			return (Array.getLength(o) == 0);
		return o.toString().isEmpty();

> Support beans as arguments for GET calls using @RemoteableMethod
> ----------------------------------------------------------------
>                 Key: JUNEAU-49
>                 URL: https://issues.apache.org/jira/browse/JUNEAU-49
>             Project: Juneau
>          Issue Type: Improvement
>            Reporter: Steve Blackmon
> The standard use case for wrapping a GET call with query parameters in a rest proxy is
to enumerate each of the possible get params in order and attach @query to each.
> However, when the number of possible parameters becomes large and many are optional,
the ability for the proxy to extract multiple params from a bean would make implementation
much more readable.
> Enable pojo arguments annotated @Query("\*") or @QueryIfNE("\*”) in a method annotated
@RemoteableMethod(httpMethod="GET") to serve as a source for multiple parameters (all query
parameters for now)

This message was sent by Atlassian JIRA

View raw message