blob: 242c551f8764241b3bf1e6cffa4f23ce43fb25e5 (
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
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.query.profile;
import com.yahoo.processing.request.CompoundName;
import com.yahoo.search.query.profile.types.FieldType;
import com.yahoo.search.query.properties.PropertyMap;
/**
* A map which stores all types which cannot be stored in a query profile
* that is rich model objects.
* <p>
* This map will deep copy not only the model object map, but also each
* clonable member in the map.
*
* @author bratseth
*/
public class ModelObjectMap extends PropertyMap {
/** Returns true if the class of the value is not acceptable as a query profile value */
@Override
protected boolean shouldSet(CompoundName name,Object value) {
if (value==null) return true;
return FieldType.fromClass(value.getClass())==null;
}
}
|