blob: ff8c4845845bdcd1a52905bb648ae7c1d6d49a5d (
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
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.query.profile.types;
import com.yahoo.component.provider.ComponentRegistry;
import com.yahoo.search.Query;
import com.yahoo.search.query.profile.QueryProfileRegistry;
/**
* A registry of query profile types
*
* @author bratseth
*/
public class QueryProfileTypeRegistry extends ComponentRegistry<QueryProfileType> {
public QueryProfileTypeRegistry() {
Query.addNativeQueryProfileTypesTo(this);
}
/** Register this type by its id */
public void register(QueryProfileType type) {
super.register(type.getId(), type);
}
@Override
public void freeze() {
if (isFrozen()) return;
for (QueryProfileType queryProfileType : allComponents())
queryProfileType.freeze();
}
public static QueryProfileTypeRegistry emptyFrozen() {
QueryProfileTypeRegistry registry = new QueryProfileTypeRegistry();
registry.freeze();
return registry;
}
}
|