public class DefaultErrorHit extends Hit implements ErrorHit, Cloneable
Modifier and Type | Field and Description |
---|---|
private List<ErrorMessage> |
errors
A list of unique error messages, where the first is considered the "main"
error.
|
RANKFEATURES_FIELD, SDDOCNAME_FIELD
Constructor and Description |
---|
DefaultErrorHit(String source,
ErrorMessage error)
Creates an error hit with one error
|
DefaultErrorHit(String source,
List<ErrorMessage> errors)
Creates an error hit with a list of errors
|
Modifier and Type | Method and Description |
---|---|
void |
addError(ErrorMessage error)
Adds an error to this
|
void |
addErrors(ErrorHit errorHit)
Add all errors from another error hit to this
|
DefaultErrorHit |
clone() |
Iterator<ErrorMessage> |
errorIterator()
Returns all the detail errors of this error hit, not including the main error.
|
Set<ErrorMessage> |
errors()
Returns a read-only set containing all the error of this
|
ErrorMessage |
getMainError()
Deprecated.
use
errors() |
boolean |
hasOnlyErrorCode(int code)
Returns true if all errors in this have the given code
|
boolean |
isMeta()
Returns true - this is a meta hit containing information on other hits
|
private void |
removeAndAdd(ErrorMessage error)
This is basically a way of making a list simulate a set.
|
void |
setSource(String source)
Sets the name of the source creating this hit
|
String |
toString()
Returns a string describing this hit
|
assignId, buildHitField, buildHitField, buildHitField, changeFieldKey, clearFields, compareTo, equals, fieldIterator, fieldKeys, fields, getAddNumber, getDisplayId, getField, getFieldXML, getFilled, getFilledInternal, getId, getQuery, getRelevance, getSearcherSpecificMetaData, getSource, getSourceNumber, getTypeString, getUnboldedField, hashCode, isAuxiliary, isCached, isFillable, isFilled, removeField, request, reserve, setAddNumber, setAuxiliary, setCached, setField, setFillable, setFilled, setFilledInternal, setId, setId, setMeta, setQuery, setRelevance, setRelevance, setSearcherSpecificMetaData, setSourceNumber, stripCharacter, types
addFreezeListener, freeze
private List<ErrorMessage> errors
public DefaultErrorHit(String source, ErrorMessage error)
source
- the name of the source or backend of this hiterror
- an initial error to add to this hit, cannot be nullpublic DefaultErrorHit(String source, List<ErrorMessage> errors)
source
- the name of the source or backend of this hiterrors
- a list of errors for this to hold. The list will not be modified or retained.public void setSource(String source)
Hit
@Deprecated public ErrorMessage getMainError()
errors()
getMainError
in interface ErrorHit
private void removeAndAdd(ErrorMessage error)
public void addError(ErrorMessage error)
public void addErrors(ErrorHit errorHit)
public Iterator<ErrorMessage> errorIterator()
errorIterator
in interface ErrorHit
public Set<ErrorMessage> errors()
public String toString()
Hit
public boolean isMeta()
public boolean hasOnlyErrorCode(int code)
hasOnlyErrorCode
in interface ErrorHit
public DefaultErrorHit clone()
Copyright © 2017. All rights reserved.