@Test public void shouldBeCloneable() { assertEquals(doc, doc.clone()); }
@Override public MutableDocument clone() { BasicDocument clone = new BasicDocument(); for (Field field : this.fields()) { Object value = unwrap(field.getValue()); if (value instanceof Array) { value = ((Array)value).clone(); } else if (value instanceof Document) { value = ((Document)value).clone(); } clone.put(field.getName(), value); } return clone; }
BasicDocument extends LinkedHashMap<String, Object> implements MutableDocument { @Override public MutableDocument clone() { BasicDocument clone = new BasicDocument(); for (Field field : this.fields()) { Object value = unwrap(field.getValue()); if (value instanceof Array) { value = ((Array)value).clone(); } else if (value instanceof Document) { value = ((Document)value).clone(); } clone.put(field.getName(), value); } return clone; } }
BasicDocument extends LinkedHashMap<String, Object> implements MutableDocument { @Override public MutableDocument clone() { BasicDocument clone = new BasicDocument(); for (Field field : this.fields()) { Object value = unwrap(field.getValue()); if (value instanceof Array) { value = ((Array)value).clone(); } else if (value instanceof Document) { value = ((Document)value).clone(); } clone.put(field.getName(), value); } return clone; } BasicDocument();  BasicDocument( Document document );  BasicDocument( int initialCapacity );  BasicDocument( String name,
                          Object value );  BasicDocument( String name1,
                          Object value1,
                          String name2,
                          Object value2 );  BasicDocument( String name1,
                          Object value1,
                          String name2,
                          Object value2,
                          String name3,
                          Object value3 );  BasicDocument( String name1,
                          Object value1,
                          String name2,
                          Object value2,
                          String name3,
                          Object value3,
                          String name4,
                          Object value4 ); }
BasicDocument extends LinkedHashMap<String, Object> implements MutableDocument { @Override public MutableDocument clone() { BasicDocument clone = new BasicDocument(); for (Field field : this.fields()) { Object value = unwrap(field.getValue()); if (value instanceof Array) { value = ((Array)value).clone(); } else if (value instanceof Document) { value = ((Document)value).clone(); } clone.put(field.getName(), value); } return clone; } BasicDocument();  BasicDocument( Document document );  BasicDocument( int initialCapacity );  BasicDocument( String name,
                          Object value );  BasicDocument( String name1,
                          Object value1,
                          String name2,
                          Object value2 );  BasicDocument( String name1,
                          Object value1,
                          String name2,
                          Object value2,
                          String name3,
                          Object value3 );  BasicDocument( String name1,
                          Object value1,
                          String name2,
                          Object value2,
                          String name3,
                          Object value3,
                          String name4,
                          Object value4 ); @Override boolean containsField( String name ); @Override boolean containsAll( Document document ); @Override Object get( String name ); @Override Map<String, ?> toMap(); @Override Iterable<Field> fields(); @Override Boolean getBoolean( String name ); @Override boolean getBoolean( String name,
                               boolean defaultValue ); @Override Integer getInteger( String name ); @Override int getInteger( String name,
                           int defaultValue ); @Override Long getLong( String name ); @Override long getLong( String name,
                         long defaultValue ); @Override Double getDouble( String name ); @Override double getDouble( String name,
                             double defaultValue ); @Override Number getNumber( String name ); @Override Number getNumber( String name,
                             Number defaultValue ); @Override Date getDate(String name); @Override String getString( String name ); @Override String getString( String name,
                             String defaultValue ); @Override List<?> getArray( String name ); @Override Document getDocument( String name ); @Override boolean isNull( String name ); @Override boolean isNullOrMissing( String name ); @Override MaxKey getMaxKey( String name ); @Override MinKey getMinKey( String name ); @Override Code getCode( String name ); @Override CodeWithScope getCodeWithScope( String name ); @Override ObjectId getObjectId( String name ); @Override Binary getBinary( String name ); @Override Symbol getSymbol( String name ); @Override Pattern getPattern( String name ); @Override UUID getUuid( String name ); @Override UUID getUuid( String name,
                         UUID defaultValue ); @Override int getType( String name ); @Override void putAll( Document object ); @Override Object remove( String name ); @Override void removeAll(); @Override int hashCode(); @Override boolean equals( Object obj ); @Override String toString(); @Override MutableDocument clone(); @Override Document with( Map<String, Object> changedFields ); @Override Document with( String fieldName,
                          Object newValue ); @Override Document with( ValueTransformer transformer ); @Override Document withVariablesReplaced( Properties properties ); @Override Document withVariablesReplacedWithSystemProperties(); }
BasicDocument extends LinkedHashMap<String, Object> implements MutableDocument { @Override public MutableDocument clone() { BasicDocument clone = new BasicDocument(); for (Field field : this.fields()) { Object value = unwrap(field.getValue()); if (value instanceof Array) { value = ((Array)value).clone(); } else if (value instanceof Document) { value = ((Document)value).clone(); } clone.put(field.getName(), value); } return clone; } BasicDocument();  BasicDocument( Document document );  BasicDocument( int initialCapacity );  BasicDocument( String name,
                          Object value );  BasicDocument( String name1,
                          Object value1,
                          String name2,
                          Object value2 );  BasicDocument( String name1,
                          Object value1,
                          String name2,
                          Object value2,
                          String name3,
                          Object value3 );  BasicDocument( String name1,
                          Object value1,
                          String name2,
                          Object value2,
                          String name3,
                          Object value3,
                          String name4,
                          Object value4 ); @Override boolean containsField( String name ); @Override boolean containsAll( Document document ); @Override Object get( String name ); @Override Map<String, ?> toMap(); @Override Iterable<Field> fields(); @Override Boolean getBoolean( String name ); @Override boolean getBoolean( String name,
                               boolean defaultValue ); @Override Integer getInteger( String name ); @Override int getInteger( String name,
                           int defaultValue ); @Override Long getLong( String name ); @Override long getLong( String name,
                         long defaultValue ); @Override Double getDouble( String name ); @Override double getDouble( String name,
                             double defaultValue ); @Override Number getNumber( String name ); @Override Number getNumber( String name,
                             Number defaultValue ); @Override Date getDate(String name); @Override String getString( String name ); @Override String getString( String name,
                             String defaultValue ); @Override List<?> getArray( String name ); @Override Document getDocument( String name ); @Override boolean isNull( String name ); @Override boolean isNullOrMissing( String name ); @Override MaxKey getMaxKey( String name ); @Override MinKey getMinKey( String name ); @Override Code getCode( String name ); @Override CodeWithScope getCodeWithScope( String name ); @Override ObjectId getObjectId( String name ); @Override Binary getBinary( String name ); @Override Symbol getSymbol( String name ); @Override Pattern getPattern( String name ); @Override UUID getUuid( String name ); @Override UUID getUuid( String name,
                         UUID defaultValue ); @Override int getType( String name ); @Override void putAll( Document object ); @Override Object remove( String name ); @Override void removeAll(); @Override int hashCode(); @Override boolean equals( Object obj ); @Override String toString(); @Override MutableDocument clone(); @Override Document with( Map<String, Object> changedFields ); @Override Document with( String fieldName,
                          Object newValue ); @Override Document with( ValueTransformer transformer ); @Override Document withVariablesReplaced( Properties properties ); @Override Document withVariablesReplacedWithSystemProperties();  }