aboutsummaryrefslogtreecommitdiffstats
path: root/persistence/src/main/java/com/yahoo/persistence/spi/result/BucketIdListResult.java
blob: c02b7384fe54df947d08cf4b0ea2bc485cb64db9 (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
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.persistence.spi.result;

import com.yahoo.document.BucketId;

import java.util.List;

/**
 * Result class used for bucket id list requests.
 */
public class BucketIdListResult extends Result {
    List<BucketId> buckets;

    /**
     * Creates a result with an error.
     *
     * @param type The type of error
     * @param message A human-readable error message to further detail the error.
     */
    public BucketIdListResult(ErrorType type, String message) {
        super(type, message);
    }

    /**
     * Creates a result containing a list of all the buckets the requested partition has.
     *
     * @param buckets The list of buckets.
     */
    public BucketIdListResult(List<BucketId> buckets) {
        this.buckets = buckets;
    }

    public List<BucketId> getBuckets() {
        return buckets;
    }
}