Package com.yahoo.search.result
Class DefaultErrorHit
- java.lang.Object
-
- com.yahoo.component.provider.FreezableClass
-
- com.yahoo.component.provider.ListenableFreezableClass
-
- com.yahoo.search.result.Hit
-
- com.yahoo.search.result.DefaultErrorHit
-
- All Implemented Interfaces:
com.yahoo.component.provider.Freezable
,com.yahoo.component.provider.ListenableFreezable
,com.yahoo.processing.response.Data
,ErrorHit
,java.lang.Cloneable
,java.lang.Comparable<Hit>
public class DefaultErrorHit extends Hit implements ErrorHit, java.lang.Cloneable
A hit which holds a list of error conditions in a result.- Author:
- bratseth, Steinar Knutsen
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.yahoo.search.result.Hit
Hit.RawUtf8Consumer
-
-
Field Summary
-
Fields inherited from class com.yahoo.search.result.Hit
RANKFEATURES_FIELD, SDDOCNAME_FIELD
-
-
Constructor Summary
Constructors Constructor Description DefaultErrorHit(java.lang.String source, ErrorMessage error)
Creates an error hit with one errorDefaultErrorHit(java.lang.String source, java.util.List<ErrorMessage> errors)
Creates an error hit with a list of errors
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addError(ErrorMessage error)
Adds an error to thisvoid
addErrors(ErrorHit errorHit)
Add all errors from another error hit to thisDefaultErrorHit
clone()
java.util.Iterator<ErrorMessage>
errorIterator()
Returns all the detail errors of this error hit, not including the main error.java.util.Set<ErrorMessage>
errors()
Returns a read-only set containing all the error of thisboolean
hasOnlyErrorCode(int code)
Returns true if all errors in this have the given codeboolean
isMeta()
Returns true - this is a meta hit containing information on other hitsvoid
setSource(java.lang.String source)
Sets the name of the source creating this hitjava.lang.String
toString()
-
Methods inherited from class com.yahoo.search.result.Hit
assignId, buildHitField, clearFields, close, compareTo, equals, features, fieldIterator, fieldKeys, fields, forEachField, forEachFieldAsRaw, getDisplayId, getField, getFilled, getId, getQuery, getRelevance, getSearcherSpecificMetaData, getSource, hasField, hasFields, hashCode, isAuxiliary, isCached, isFillable, isFilled, removeField, request, reserve, setAuxiliary, setCached, setField, setFillable, setFilled, setId, setId, setMeta, setQuery, setRelevance, setRelevance, setSearcherSpecificMetaData, types
-
Methods inherited from class com.yahoo.component.provider.ListenableFreezableClass
addFreezeListener, freeze
-
-
-
-
Constructor Detail
-
DefaultErrorHit
public DefaultErrorHit(java.lang.String source, ErrorMessage error)
Creates an error hit with one error- Parameters:
source
- the name of the source or backend of this hiterror
- an initial error to add to this hit, cannot be null
-
DefaultErrorHit
public DefaultErrorHit(java.lang.String source, java.util.List<ErrorMessage> errors)
Creates an error hit with a list of errors- Parameters:
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.
-
-
Method Detail
-
setSource
public void setSource(java.lang.String source)
Description copied from class:Hit
Sets the name of the source creating this hit
-
addError
public void addError(ErrorMessage error)
Adds an error to this
-
addErrors
public void addErrors(ErrorHit errorHit)
Add all errors from another error hit to this
-
errorIterator
public java.util.Iterator<ErrorMessage> errorIterator()
Returns all the detail errors of this error hit, not including the main error. The iterator is modifiable.- Specified by:
errorIterator
in interfaceErrorHit
-
errors
public java.util.Set<ErrorMessage> errors()
Returns a read-only set containing all the error of this
-
isMeta
public boolean isMeta()
Returns true - this is a meta hit containing information on other hits
-
hasOnlyErrorCode
public boolean hasOnlyErrorCode(int code)
Returns true if all errors in this have the given code- Specified by:
hasOnlyErrorCode
in interfaceErrorHit
-
clone
public DefaultErrorHit clone()
-
-