Yuta HIGUCHI | 9ee60f6 | 2014-10-09 10:00:01 -0700 | [diff] [blame^] | 1 | package org.onlab.onos.store.common.impl; |
| 2 | |
| 3 | import org.onlab.onos.cluster.ControllerNode; |
| 4 | import org.onlab.onos.cluster.NodeId; |
| 5 | |
| 6 | import com.google.common.base.Function; |
| 7 | |
| 8 | /** |
| 9 | * Function to convert ControllerNode to NodeId. |
| 10 | */ |
| 11 | public 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 | } |