Package org.apache.solr.common

# Class ToleratedUpdateError

java.lang.Object
org.apache.solr.common.ToleratedUpdateError

public final class ToleratedUpdateError extends Object
Models the basic information related to a single "tolerated" error that occurred during updates. This class is only useful when the `TolerantUpdateProcessorFactory` is used in an update processor chain

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`ToleratedUpdateError.CmdType`
Helper class for dealing with SolrException metadata (String) keys

## Constructor Summary

Constructors
Constructor
Description
`ToleratedUpdateError(ToleratedUpdateError.CmdType type, String id, String message)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object o)`
`static List<SimpleOrderedMap<String>>`
`formatForResponseHeader(List<ToleratedUpdateError> errs)`
returns a list of maps of simple objects suitable for putting in a SolrQueryResponse header
`static int`
`getEffectiveMaxErrors(int maxErrors)`
Given a 'maxErrors' value such that`-1 <= maxErrors <= `Integer.MAX_VALUE`` this method returns the original input unless it is `-1` in which case the effective value of `Integer.MAX_VALUE` is returned.
`String`
`getId()`
`String`
`getMessage()`
`String`
`getMetadataKey()`
returns a string suitable for use as a key in `SolrException.setMetadata(org.apache.solr.common.util.NamedList<java.lang.String>)`
`String`
`getMetadataValue()`
returns a string suitable for use as a value in `SolrException.setMetadata(org.apache.solr.common.util.NamedList<java.lang.String>)`
`SimpleOrderedMap<String>`
`getSimpleMap()`
returns a map of simple objects suitable for putting in a SolrQueryResponse header
`ToleratedUpdateError.CmdType`
`getType()`
`static int`
`getUserFriendlyMaxErrors(int maxErrors)`
Given a 'maxErrors' value such that`-1 <= maxErrors <= `Integer.MAX_VALUE`` this method returns the original input unless it is `Integer.MAX_VALUE` in which case `-1` is returned for user convenience.
`int`
`hashCode()`
`static ToleratedUpdateError`
`parseMap(SimpleOrderedMap<String> data)`
returns a ToleratedUpdateError instance from the data in this Map
`static ToleratedUpdateError`
`parseMetadataIfToleratedUpdateError(String metadataKey, String metadataVal)`
returns a ToleratedUpdateError instance if this metadataKey is one we care about, else null
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### ToleratedUpdateError

public ToleratedUpdateError(ToleratedUpdateError.CmdType type, String id, String message)

## Method Details

### getEffectiveMaxErrors

public static int getEffectiveMaxErrors(int maxErrors)
Given a 'maxErrors' value such that`-1 <= maxErrors <= `Integer.MAX_VALUE`` this method returns the original input unless it is `-1` in which case the effective value of `Integer.MAX_VALUE` is returned. Input of `maxErrors < -1` will trip an assertion and otherwise have undefined behavior.

See Also:
  - `getUserFriendlyMaxErrors(int)`

### getUserFriendlyMaxErrors

public static int getUserFriendlyMaxErrors(int maxErrors)
Given a 'maxErrors' value such that`-1 <= maxErrors <= `Integer.MAX_VALUE`` this method returns the original input unless it is `Integer.MAX_VALUE` in which case `-1` is returned for user convenience. Input of `maxErrors < -1` will trip an assertion and otherwise have undefined behavior.

See Also:
  - `getEffectiveMaxErrors(int)`

### formatForResponseHeader

public static List<SimpleOrderedMap<String>> formatForResponseHeader(List<ToleratedUpdateError> errs)
returns a list of maps of simple objects suitable for putting in a SolrQueryResponse header

See Also:
  - `getSimpleMap()`
  - `parseMap(org.apache.solr.common.util.SimpleOrderedMap<java.lang.String>)`

### parseMap

public static ToleratedUpdateError parseMap(SimpleOrderedMap<String> data)
returns a ToleratedUpdateError instance from the data in this Map

See Also:
  - `getSimpleMap()`

### parseMetadataIfToleratedUpdateError

public static ToleratedUpdateError parseMetadataIfToleratedUpdateError(String metadataKey, String metadataVal)
returns a ToleratedUpdateError instance if this metadataKey is one we care about, else null

See Also:
  - `getMetadataKey()`
  - `getMetadataValue()`

### getType

public ToleratedUpdateError.CmdType getType()

### getId

public String getId()

### getMessage

public String getMessage()

### getMetadataKey

public String getMetadataKey()
returns a string suitable for use as a key in `SolrException.setMetadata(org.apache.solr.common.util.NamedList<java.lang.String>)`

See Also:
  - `parseMetadataIfToleratedUpdateError(java.lang.String, java.lang.String)`

### getMetadataValue

public String getMetadataValue()
returns a string suitable for use as a value in `SolrException.setMetadata(org.apache.solr.common.util.NamedList<java.lang.String>)`

See Also:
  - `parseMetadataIfToleratedUpdateError(java.lang.String, java.lang.String)`

### getSimpleMap

public SimpleOrderedMap<String> getSimpleMap()
returns a map of simple objects suitable for putting in a SolrQueryResponse header

See Also:
  - `formatForResponseHeader(java.util.List<org.apache.solr.common.ToleratedUpdateError>)`
  - `parseMap(org.apache.solr.common.util.SimpleOrderedMap<java.lang.String>)`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object o)

Overrides:
  `equals` in class `Object`