pivot-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven Swor (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PIVOT-558) BeanAdapter should have a putAll method to allow multiple property set in one method call...especially useful when setting properties from a JSON string
Date Wed, 17 Oct 2012 06:32:03 GMT

    [ https://issues.apache.org/jira/browse/PIVOT-558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13477659#comment-13477659
] 

Steven Swor commented on PIVOT-558:
-----------------------------------

{quote}
If we were to provide such a feature in the framework, I would want to put it in a static
method in a static Map.Util class or something similar so all maps could take advantage of
it. However, I'm not recommending either approach because I don't think it adds sufficient
value. 
{quote}

This definitely has value for an application developer. It's one line of code to maintain
versus three, for every time the developer needs the semantics of {{putAll}}.  That can add
up very quickly, and it makes the code much easier to read.
                
> BeanAdapter should have a putAll method to allow multiple property set in one method
call...especially useful when setting properties from a JSON string
> --------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: PIVOT-558
>                 URL: https://issues.apache.org/jira/browse/PIVOT-558
>             Project: Pivot
>          Issue Type: Improvement
>          Components: core-beans
>            Reporter: Appddevvv
>            Assignee: Sandro Martini
>            Priority: Minor
>             Fix For: 2.1
>
>
> API:
> public void putAll(Map<String, ?> values)
> public boolean putAll(Map<String, ?> values, boolean ignoreErrors)
> where ignore errors indicates that any errors/exceptions thrown should be caught. If
any are thrown or errors occur, true is returned, otherwise false.
> I'll submit a patch if you accept this improvement.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message