Package org.apache.solr.common

## Interface MapWriter

All Superinterfaces:
  `org.noggit.JSONWriter.Writable`, `MapSerializable`, `NavigableObject`

All Known Subinterfaces:
  `ReflectMapWriter`, `SimpleMap<T>`

All Known Implementing Classes:
  `AliasesApi.DeleteAliasResponse`, `AliasesApi.GetAliasByNameResponse`, `AliasesApi.GetAliasesResponse`, `AliasPropertiesApi.CreateOrUpdateAliasPropertyResponse`, `AliasPropertiesApi.DeleteAliasPropertyResponse`, `AliasPropertiesApi.GetAliasPropertyResponse`, `AliasPropertiesApi.GetAllAliasPropertiesResponse`, `AliasPropertiesApi.UpdateAliasPropertiesResponse`, `AnalysisResponseBase`, `AppendedSolrParams`, `BackupCollectionPayload`, `CloudSolrClient.RouteResponse`, `ClusterApi.BalanceReplicasResponse`, `ClusterApi.MigrateReplicasResponse`, `ClusterPropPayload`, `ClusterPropPayload.Cluster`, `ClusterPropPayload.CollectionDefaults`, `ClusterPropPayload.Defaults`, `ClusterState`, `CollectionAdminRequest`, `CollectionAdminRequest.AddReplica`, `CollectionAdminRequest.AddReplicaProp`, `CollectionAdminRequest.AddRole`, `CollectionAdminRequest.AsyncCollectionAdminRequest`, `CollectionAdminRequest.AsyncCollectionSpecificAdminRequest`, `CollectionAdminRequest.AsyncShardSpecificAdminRequest`, `CollectionAdminRequest.Backup`, `CollectionAdminRequest.BalanceShardUnique`, `CollectionAdminRequest.ClusterProp`, `CollectionAdminRequest.ClusterStatus`, `CollectionAdminRequest.CollectionAdminRoleRequest`, `CollectionAdminRequest.CollectionProp`, `CollectionAdminRequest.ColStatus`, `CollectionAdminRequest.Create`, `CollectionAdminRequest.CreateAlias`, `CollectionAdminRequest.CreateCategoryRoutedAlias`, `CollectionAdminRequest.CreateShard`, `CollectionAdminRequest.CreateSnapshot`, `CollectionAdminRequest.CreateTimeRoutedAlias`, `CollectionAdminRequest.Delete`, `CollectionAdminRequest.DeleteAlias`, `CollectionAdminRequest.DeleteBackup`, `CollectionAdminRequest.DeleteNode`, `CollectionAdminRequest.DeleteReplica`, `CollectionAdminRequest.DeleteReplicaProp`, `CollectionAdminRequest.DeleteShard`, `CollectionAdminRequest.DeleteSnapshot`, `CollectionAdminRequest.DeleteStatus`, `CollectionAdminRequest.DimensionalRoutedAlias`, `CollectionAdminRequest.ForceLeader`, `CollectionAdminRequest.InstallShard`, `CollectionAdminRequest.List`, `CollectionAdminRequest.ListAliases`, `CollectionAdminRequest.ListBackup`, `CollectionAdminRequest.ListSnapshots`, `CollectionAdminRequest.Migrate`, `CollectionAdminRequest.MockCollTask`, `CollectionAdminRequest.Modify`, `CollectionAdminRequest.MoveReplica`, `CollectionAdminRequest.OverseerStatus`, `CollectionAdminRequest.RebalanceLeaders`, `CollectionAdminRequest.ReindexCollection`, `CollectionAdminRequest.Reload`, `CollectionAdminRequest.RemoveRole`, `CollectionAdminRequest.Rename`, `CollectionAdminRequest.ReplaceNode`, `CollectionAdminRequest.RequestApiDistributedProcessing`, `CollectionAdminRequest.RequestApiDistributedProcessingResponse`, `CollectionAdminRequest.RequestStatus`, `CollectionAdminRequest.RequestStatusResponse`, `CollectionAdminRequest.Restore`, `CollectionAdminRequest.SetAliasProperty`, `CollectionAdminRequest.ShardSpecificAdminRequest`, `CollectionAdminRequest.SplitShard`, `CollectionAdminResponse`, `CollectionBackupsApi.CreateCollectionBackupResponse`, `CollectionBackupsApi.DeleteMultipleBackupsByRecencyResponse`, `CollectionBackupsApi.DeleteSingleBackupByIdResponse`, `CollectionBackupsApi.GarbageCollectUnusedBackupFilesResponse`, `CollectionBackupsApi.ListBackupsAtLocationResponse`, `CollectionPropertiesApi.CreateOrUpdateCollectionPropertyResponse`, `CollectionPropertiesApi.DeleteCollectionPropertyResponse`, `CollectionsApi.BalanceShardUniqueResponse`, `CollectionsApi.CreateCollectionResponse`, `CollectionsApi.DeleteCollectionResponse`, `CollectionsApi.ListCollectionsResponse`, `CollectionsApi.ReloadCollectionResponse`, `CollectionsApi.RenameCollectionResponse`, `CollectionSnapshotsApi.CreateCollectionSnapshotResponse`, `CollectionSnapshotsApi.DeleteCollectionSnapshotResponse`, `ConditionalKeyMapWriter`, `ConditionalMapWriter`, `ConfigSetAdminResponse`, `ConfigSetAdminResponse.List`, `ConfigsetsApi.ListConfigSetResponse`, `CoreAdminResponse`, `CoreBackupsApi.CreateBackupResponse`, `CoresApi.InstallCoreDataResponse`, `CoresApi.MergeIndexesResponse`, `CoresApi.ReloadCoreResponse`, `CoresApi.RenameCoreResponse`, `CoresApi.RestoreCoreResponse`, `CoresApi.SwapCoresResponse`, `CoresApi.UnloadCoreResponse`, `CoreSnapshotsApi.CreateSnapshotResponse`, `CoreSnapshotsApi.DeleteSnapshotResponse`, `CoreSnapshotsApi.ListSnapshotsResponse`, `CreateConfigPayload`, `CreateCorePayload`, `CreateShardPayload`, `DefaultSolrParams`, `DelegationTokenResponse`, `DelegationTokenResponse.Cancel`, `DelegationTokenResponse.Get`, `DelegationTokenResponse.Renew`, `DeleteBasicAuthUserPayload`, `DocCollection`, `DocumentAnalysisResponse`, `FieldAnalysisResponse`, `FileStoreApi.DeleteFileResponse`, `FileStoreApi.UploadFileResponse`, `HealthCheckResponse`, `JacksonParsingResponse`, `LinkedHashMapWriter`, `LukeResponse`, `MapSolrParams`, `MapWriterMap`, `MigrateDocsPayload`, `ModifiableSolrParams`, `ModifyCollectionPayload`, `MoveReplicaPayload`, `MultiMapSolrParams`, `NamedList`, `NodeApi.DeleteNodeResponse`, `NodeApi.GetCommandStatusResponse`, `NodeApi.GetPublicKeyResponse`, `NodeApi.ReplaceNodeResponse`, `OverseerOperationPayload`, `PackagePayload.AddVersion`, `PackagePayload.DelVersion`, `Pair`, `PerReplicaStates`, `PerReplicaStates.State`, `PluginMeta`, `PrepareCoreRecoveryPayload`, `QueryingApi.JsonQueryResponse`, `QueryingApi.QueryResponse`, `QueryResponse`, `RateLimiterPayload`, `RebalanceLeadersPayload`, `RejoinLeaderElectionPayload`, `Replica`, `ReplicaPropertiesApi.AddReplicaPropertyResponse`, `ReplicaPropertiesApi.DeleteReplicaPropertyResponse`, `ReplicasApi.CreateReplicaResponse`, `ReplicasApi.DeleteReplicaByNameResponse`, `ReplicasApi.DeleteReplicasByCountAllShardsResponse`, `ReplicasApi.DeleteReplicasByCountResponse`, `RequestApplyCoreUpdatesPayload`, `RequestBufferUpdatesPayload`, `RequestCoreRecoveryPayload`, `RequestSyncShardPayload`, `RequiredSolrParams`, `RoutingRule`, `SchemaApi.GetSchemaInfoResponse`, `SchemaApi.GetSchemaNameResponse`, `SchemaApi.GetSchemaSimilarityResponse`, `SchemaApi.GetSchemaUniqueKeyResponse`, `SchemaApi.GetSchemaVersionResponse`, `SchemaApi.GetSchemaZkVersionResponse`, `SchemaResponse`, `SchemaResponse.CopyFieldsResponse`, `SchemaResponse.DynamicFieldResponse`, `SchemaResponse.DynamicFieldsResponse`, `SchemaResponse.FieldResponse`, `SchemaResponse.FieldsResponse`, `SchemaResponse.FieldTypeResponse`, `SchemaResponse.FieldTypesResponse`, `SchemaResponse.GlobalSimilarityResponse`, `SchemaResponse.SchemaNameResponse`, `SchemaResponse.SchemaVersionResponse`, `SchemaResponse.UniqueKeyResponse`, `SchemaResponse.UpdateResponse`, `SetRuleBasedAuthPermissionPayload`, `ShardsApi.CreateShardResponse`, `ShardsApi.DeleteShardResponse`, `ShardsApi.ForceShardLeaderResponse`, `ShardsApi.InstallShardDataResponse`, `ShardsApi.SyncShardResponse`, `ShardTerms`, `SimpleOrderedMap`, `SimpleSolrResponse`, `Slice`, `SolrDocument`, `SolrDocumentBase`, `SolrDocumentList`, `SolrInputDocument`, `SolrParams`, `SolrPingResponse`, `SolrQuery`, `SolrResponse`, `SolrResponseBase`, `SplitShardPayload`, `UpdateResponse`, `UpdateRuleBasedAuthPermissionPayload`, `Utils.DelegateReflectWriter`, `V2Request`, `V2Response`, `WrappedSimpleMap`, `ZkNodeProps`

    public interface MapWriter
    extends MapSerializable, NavigableObject, org.noggit.JSONWriter.Writable

Use this class to push all entries of a Map into an output. This avoids creating map instances and is supposed to be memory efficient. If the entries are primitives, unnecessary boxing is also avoided.

### Nested Class Summary

Nested Classes
`static interface` `MapWriter.EntryWriter` An interface to push one entry at a time to the output.

### Field Summary

Fields
`static MapWriter` `EMPTY`

### Method Summary

All Methods Instance Methods Abstract Methods Default Methods
`default MapWriter` `append​(MapWriter another)`
`default String` `jsonStr()`
`default Map<String,​Object>` `toMap​(Map<String,​Object> map)` Use the passed map to minimize object creation.
`default void` `write​(org.noggit.JSONWriter writer)`
`void` `writeMap​(MapWriter.EntryWriter ew)`

### Methods inherited from interface org.apache.solr.common.NavigableObject

`_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr, _size`

### Field Detail

#### EMPTY

    static final MapWriter EMPTY

### Method Detail

#### jsonStr

    default String jsonStr()

#### toMap

    default Map<String,​Object> toMap​(Map<String,​Object> map)

Description copied from interface: `MapSerializable`
Use the passed map to minimize object creation. Do not keep a reference to the passed map and reuse it. it may be reused by the framework

Specified by:
  `toMap` in interface `MapSerializable`

#### write

    default void write​(org.noggit.JSONWriter writer)

Specified by:
  `write` in interface `org.noggit.JSONWriter.Writable`

#### writeMap

    void writeMap​(MapWriter.EntryWriter ew)
           throws IOException

Throws:
  `IOException`

#### append

    default MapWriter append​(MapWriter another)