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