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
ConstructorsConstructorDescriptionDefaultErrorHit(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 TypeMethodDescriptionvoidaddError(ErrorMessage error) Adds an error to thisvoidAdd 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 thisbooleanhasOnlyErrorCode(int code) Returns true if all errors in this have the given codebooleanisMeta()Returns true - this is a meta hit containing information on other hitsvoidSets 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, typesMethods inherited from class com.yahoo.component.provider.ListenableFreezableClass
addFreezeListener, freezeMethods inherited from class com.yahoo.component.provider.FreezableClass
ensureNotFrozen, isFrozenMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.yahoo.component.provider.Freezable
freeze, isFrozenMethods 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:HitSets 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:
errorIteratorin 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:
hasOnlyErrorCodein interfaceErrorHit
-
clone
-