aboutsummaryrefslogtreecommitdiffstats
path: root/container-core/src/main/java/com/yahoo/component/chain/dependencies/ordering/ComponentNode.java
blob: 92ce7000c29dd37d3b4922346f06c5a604733890 (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 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;

import com.yahoo.component.chain.ChainedComponent;

/**
 * A node representing a given component.
 *
 * @see Node
 * @author Tony Vaagenes
 */
class ComponentNode<T extends ChainedComponent> extends Node {

    private T component;

    public ComponentNode(T component, int priority) {
        super(priority);
        this.component = component;
    }

    T getComponent() {
        return component;
    }

    @Override
    protected String dotName() {
        //TODO: config dependent name
        return component.getClass().getSimpleName();
    }

    @Override
    int classPriority() {
        return 2;
    }

}