aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/result/ErrorHit.java
blob: b89994d63da348394874026b32083b79686b00b8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.result;

import java.util.Iterator;
import java.util.Set;

/**
 * A hit which holds information on error conditions in a result.
 * An error hit maintains a main error - the main error of the result.
 *
 * @author bratseth
 */
public interface ErrorHit extends Cloneable {

    void setSource(String source);

    /**
     * Adds an error to this. This may change the main error
     * and/or the list of detailed errors
     */
    void addError(ErrorMessage error);

    /** Add all errors from another error hit to this */
    void addErrors(ErrorHit errorHit);

    /**
     * Returns all the detail errors of this error hit, including the main error
     */
    Iterator<? extends ErrorMessage> errorIterator();

    /** Returns a read-only set containing all the error of this, including the main error */
    Set<ErrorMessage> errors();

    /** Returns true - this is a meta hit containing information on other hits */
    boolean isMeta();

    /** Returns true if all errors in this has the given error code */
    boolean hasOnlyErrorCode(int code);

    Object clone();

}