2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.openflowplugin.impl.registry.flow;
11 import com.google.common.base.Preconditions;
12 import org.opendaylight.openflowplugin.api.openflow.registry.flow.FlowDescriptor;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
17 * This class serves as factory for creating {@link org.opendaylight.openflowplugin.api.openflow.registry.flow.FlowDescriptor}
18 * Created by Martin Bobak <mbobak@cisco.com> on 9.4.2015.
20 public class FlowDescriptorFactory {
22 public static FlowDescriptor create(final short tableId, final FlowId fLowId) {
23 final TableKey tableKey = new TableKey(tableId);
24 return new FlowDescriptorDto(tableKey, fLowId);
27 private static final class FlowDescriptorDto implements FlowDescriptor {
29 private final FlowId flowId;
30 private final TableKey tableKey;
32 public FlowDescriptorDto(final TableKey tableKey, final FlowId flowId) {
33 Preconditions.checkNotNull(tableKey);
34 Preconditions.checkNotNull(flowId);
36 this.tableKey = tableKey;
40 public FlowId getFlowId() {
45 public TableKey getTableKey() {