blob: 1e0bfda986c0b733b31337877b3432ee5294d2ea (
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 Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// @author Vegard Sjonfjell
#pragma once
#include <vespa/vespalib/stllike/string.h>
namespace documentapi {
class TestAndSetCondition {
private:
vespalib::string _selection;
public:
TestAndSetCondition()
: _selection()
{}
explicit TestAndSetCondition(vespalib::stringref selection)
: _selection(selection)
{}
TestAndSetCondition(const TestAndSetCondition &) = default;
TestAndSetCondition & operator=(const TestAndSetCondition &) = default;
TestAndSetCondition(TestAndSetCondition &&) = default;
TestAndSetCondition & operator=(TestAndSetCondition &&) = default;
const vespalib::string & getSelection() const { return _selection; }
bool isPresent() const noexcept { return !_selection.empty(); }
bool operator==(const TestAndSetCondition& rhs) const noexcept {
return (_selection == rhs._selection);
}
};
}
|