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

Gary Gregory updated LOG4J2-1932:
---------------------------------
    Description: 
Add the method {{containsKey()}} method to class 
{{org.apache.logging.log4j.message.MapMessage}} which delegates to the 
underlying data:

{code:java}
    /**
     * Returns {@code true} if this data structure contains the specified key, 
{@code false} otherwise.
     *
     * @param key the key whose presence to check. May be {@code null}.
     * @return {@code true} if this data structure contains the specified key, 
{@code false} otherwise
     * @since 2.9
     */
    public boolean containsKey(final String key) {
        return data.containsKey(key);
    }
{code}


  was:
Add the method {{containsKey()}} method to class 
{{org.apache.logging.log4j.message.MapMessage}} which delegates to the 
underlying data:

{code:java}
    /**
     * Retrieve the value of the element with the specified key or null if the 
key is not present.
     * @param key The name of the element.
     * @return The value of the element or null if the key is not present.
     */
    public String get(final String key) {
        return data.getValue(key);
    }
{code}



> Add containsKey() method to class org.apache.logging.log4j.message.MapMessage
> -----------------------------------------------------------------------------
>
>                 Key: LOG4J2-1932
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1932
>             Project: Log4j 2
>          Issue Type: New Feature
>            Reporter: Gary Gregory
>            Assignee: Gary Gregory
>
> Add the method {{containsKey()}} method to class 
> {{org.apache.logging.log4j.message.MapMessage}} which delegates to the 
> underlying data:
> {code:java}
>     /**
>      * Returns {@code true} if this data structure contains the specified 
> key, {@code false} otherwise.
>      *
>      * @param key the key whose presence to check. May be {@code null}.
>      * @return {@code true} if this data structure contains the specified 
> key, {@code false} otherwise
>      * @since 2.9
>      */
>     public boolean containsKey(final String key) {
>         return data.containsKey(key);
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to