blob: c661b9c0e02e6629d4202377dbfa06680d4134af (
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
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "collectionfieldvalue.h"
#include <vespa/vespalib/util/exceptions.h>
namespace document {
CollectionFieldValue::CollectionFieldValue(const CollectionFieldValue& other)
: FieldValue(other),
_type(other._type)
{
}
void CollectionFieldValue::verifyType(const CollectionFieldValue& other) const
{
if ( ! _type->equals(*other._type)) {
throw vespalib::IllegalArgumentException(
"Cannot assign value of type " + other.getDataType()->toString()
+ " to value of type " + getDataType()->toString() + ".",
VESPA_STRLOC);
}
}
}
|