org.apache.logging.log4j.core.util
Class KeyValuePair

java.lang.Object
  extended by org.apache.logging.log4j.core.util.KeyValuePair
All Implemented Interfaces:
Serializable

@Plugin(name="KeyValuePair",
        category="Core",
        printObject=true)
public final class KeyValuePair
extends Object
implements Serializable

Key/Value pair configuration item.

Since:
2.1 implements Serializable, 2.1 implements hashCode() and equals(Object)
See Also:
Serialized Form

Nested Class Summary
static class KeyValuePair.Builder
           
 
Constructor Summary
KeyValuePair(String key, String value)
          Constructs a key/value pair.
 
Method Summary
 boolean equals(Object obj)
           
 String getKey()
          Returns the key.
 String getValue()
          Returns the value.
 int hashCode()
           
static KeyValuePair.Builder newBuilder()
           
 String toString()
           
protected  Object writeReplace()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyValuePair

public KeyValuePair(String key,
                    String value)
Constructs a key/value pair. The constructor should only be called from test classes.

Parameters:
key - The key.
value - The value.
Method Detail

getKey

public String getKey()
Returns the key.

Returns:
the key.

getValue

public String getValue()
Returns the value.

Returns:
The value.

toString

public String toString()
Overrides:
toString in class Object

newBuilder

@PluginBuilderFactory
public static KeyValuePair.Builder newBuilder()

writeReplace

protected Object writeReplace()
                       throws ObjectStreamException
Throws:
ObjectStreamException

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 1999-2015 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.