Package org.apache.solr.common

# Interface MapWriter

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

All Known Subinterfaces:
  `ReflectMapWriter`

All Known Implementing Classes:
  `AnalysisResponseBase`, `AppendedSolrParams`, `BackupCollectionPayload`, `CloudSolrClient.RouteResponse`, `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`, `ConditionalKeyMapWriter`, `ConditionalMapWriter`, `ConfigSetAdminResponse`, `ConfigSetAdminResponse.List`, `CoreAdminResponse`, `CreateShardPayload`, `DefaultSolrParams`, `DelegationTokenResponse`, `DelegationTokenResponse.Cancel`, `DelegationTokenResponse.Get`, `DelegationTokenResponse.Renew`, `DeleteBasicAuthUserPayload`, `DocCollection`, `DocumentAnalysisResponse`, `FieldAnalysisResponse`, `HealthCheckResponse`, `InputStreamResponse`, `LinkedHashMapWriter`, `LukeResponse`, `MapSolrParams`, `MapWriterMap`, `MigrateDocsPayload`, `ModifiableSolrParams`, `ModifyCollectionPayload`, `MoveReplicaPayload`, `MultiMapSolrParams`, `NamedList`, `OverseerOperationPayload`, `PackagePayload.AddVersion`, `PackagePayload.DelVersion`, `Pair`, `PerReplicaStates`, `PerReplicaStates.State`, `PluginMeta`, `PrepareCoreRecoveryPayload`, `QueryResponse`, `RateLimiterPayload`, `RebalanceLeadersPayload`, `RejoinLeaderElectionPayload`, `Replica`, `RequestApplyCoreUpdatesPayload`, `RequestBufferUpdatesPayload`, `RequestCoreRecoveryPayload`, `RequestSyncShardPayload`, `RequiredSolrParams`, `RoutingRule`, `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`, `SimpleOrderedMap`, `SimpleSolrResponse`, `Slice`, `SolrDocument`, `SolrDocumentBase`, `SolrDocumentList`, `SolrInputDocument`, `SolrParams`, `SolrPingResponse`, `SolrQuery`, `SolrResponse`, `SolrResponseBase`, `SplitShardPayload`, `UpdateResponse`, `UpdateRuleBasedAuthPermissionPayload`, `Utils.DelegateReflectWriter`, `V2Request`, `V2Response`, `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
Modifier and Type
Interface
Description
`static interface`
`MapWriter.EntryWriter`
An interface to push one entry at a time to the output.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final MapWriter`
`EMPTY`
Deprecated.

## Method Summary

Modifier and Type
Method
Description
`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)`
For implementing Noggit `JSONWriter.Writable`.
`void`
`writeMap(MapWriter.EntryWriter ew)`
Writes this object's entries out to `ew`.

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

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

## Field Details

### EMPTY

@Deprecated static final MapWriter EMPTY
Deprecated.

## Method Details

### writeMap

void writeMap(MapWriter.EntryWriter ew) throws IOException
Writes this object's entries out to `ew`.

Throws:
  `IOException`

### 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)
For implementing Noggit `JSONWriter.Writable`.

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