blob: 089149468d01c804790c9448c975a1290e896121 [file] [log] [blame]
Yuta HIGUCHIdc7374c2014-10-10 11:11:09 -07001package org.onlab.onos.cluster;
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -07002
3import com.google.common.base.Function;
4
5/**
6 * Function to convert ControllerNode to NodeId.
7 */
8public final class ControllerNodeToNodeId
9 implements Function<ControllerNode, NodeId> {
10
11 private static final ControllerNodeToNodeId INSTANCE = new ControllerNodeToNodeId();
12
13 @Override
14 public NodeId apply(ControllerNode input) {
15 return input.id();
16 }
17
Yuta HIGUCHIdc7374c2014-10-10 11:11:09 -070018 /**
19 * Returns a Function to convert ControllerNode to NodeId.
20 *
21 * @return ControllerNodeToNodeId instance.
22 */
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070023 public static ControllerNodeToNodeId toNodeId() {
24 return INSTANCE;
25 }
26}