Class DefaultNoSqlObject
- java.lang.Object
-
- org.apache.logging.log4j.core.appender.nosql.DefaultNoSqlObject
-
- All Implemented Interfaces:
NoSqlObject<java.util.Map<java.lang.String,java.lang.Object>>
public class DefaultNoSqlObject extends java.lang.Object implements NoSqlObject<java.util.Map<java.lang.String,java.lang.Object>>
Default implementation ofNoSqlObject. Most NoSQL Java APIs tend to re-use the Map interface for storage and retrieval of the underlying JSON documents. Therefore, this implementation is provided for convenience.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.Object>map
-
Constructor Summary
Constructors Constructor Description DefaultNoSqlObject()Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidset(java.lang.String field, java.lang.Object value)Sets the value of a property on this object to a String or primitive.voidset(java.lang.String field, java.lang.Object[] values)Sets the value of a property on this object to an array of Strings or primitives.voidset(java.lang.String field, NoSqlObject<java.util.Map<java.lang.String,java.lang.Object>> value)Sets the value of a property on this object to a nested complex object.voidset(java.lang.String field, NoSqlObject<java.util.Map<java.lang.String,java.lang.Object>>[] values)Sets the value of a property on this object to an array of nested complex objects.java.util.Map<java.lang.String,java.lang.Object>unwrap()Obtains the underlying NoSQL library-specific object that this object wraps.
-
-
-
Method Detail
-
set
public void set(java.lang.String field, java.lang.Object value)Description copied from interface:NoSqlObjectSets the value of a property on this object to a String or primitive.- Specified by:
setin interfaceNoSqlObject<java.util.Map<java.lang.String,java.lang.Object>>- Parameters:
field- The name of the propertyvalue- The value of the property
-
set
public void set(java.lang.String field, NoSqlObject<java.util.Map<java.lang.String,java.lang.Object>> value)Description copied from interface:NoSqlObjectSets the value of a property on this object to a nested complex object.- Specified by:
setin interfaceNoSqlObject<java.util.Map<java.lang.String,java.lang.Object>>- Parameters:
field- The name of the propertyvalue- The value of the property
-
set
public void set(java.lang.String field, java.lang.Object[] values)Description copied from interface:NoSqlObjectSets the value of a property on this object to an array of Strings or primitives.- Specified by:
setin interfaceNoSqlObject<java.util.Map<java.lang.String,java.lang.Object>>- Parameters:
field- The name of the propertyvalues- The values for the property
-
set
public void set(java.lang.String field, NoSqlObject<java.util.Map<java.lang.String,java.lang.Object>>[] values)Description copied from interface:NoSqlObjectSets the value of a property on this object to an array of nested complex objects.- Specified by:
setin interfaceNoSqlObject<java.util.Map<java.lang.String,java.lang.Object>>- Parameters:
field- The name of the propertyvalues- The values for the property
-
unwrap
public java.util.Map<java.lang.String,java.lang.Object> unwrap()
Description copied from interface:NoSqlObjectObtains the underlying NoSQL library-specific object that this object wraps.- Specified by:
unwrapin interfaceNoSqlObject<java.util.Map<java.lang.String,java.lang.Object>>- Returns:
- the wrapped object.
-
-