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
,Cloneable
,Comparable<Hit>
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
ConstructorDescriptionDefaultErrorHit
(String source, ErrorMessage error) Creates an error hit with one errorDefaultErrorHit
(String source, List<ErrorMessage> errors) Creates an error hit with a list of errors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addError
(ErrorMessage error) Adds an error to thisvoid
Add all errors from another error hit to thisclone()
Returns all the detail errors of this error hit, not including the main error.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
Sets the name of the source creating this hittoString()
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
Methods inherited from class com.yahoo.component.provider.FreezableClass
ensureNotFrozen, isFrozen
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.yahoo.component.provider.Freezable
freeze, isFrozen
Methods inherited from interface com.yahoo.component.provider.ListenableFreezable
addFreezeListener
-
Constructor Details
-
DefaultErrorHit
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
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 Details
-
setSource
Description copied from class:Hit
Sets the name of the source creating this hit -
addError
Adds an error to this -
addErrors
Add all errors from another error hit to this -
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
Returns a read-only set containing all the error of this -
toString
-
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
-