aboutsummaryrefslogtreecommitdiffstats
path: root/container-core/src/main/java/com/yahoo/component/chain/dependencies/ordering/PhaseNameProvider.java
blob: 6d2706665aa9bdb72118906ab36c330cc8196133 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.component.chain.dependencies.ordering;

/**
 * A phase providing a given name.
 *
 * @author Tony Vaagenes
 */
class PhaseNameProvider extends NameProvider {

    public PhaseNameProvider(String name, int priority) {
        super(name,priority);
    }

    protected void addNode(ComponentNode<?> newNode) {
        throw new ConflictingNodeTypeException("Both a phase and a searcher provides the name '" + name + "'");
    }

    @Override
    public String toString() {
        return getClass().getSimpleName() + "[name = " + name + "]";
    }


    @Override
    int classPriority() {
        return 0;
    }

}