2 * Copyright 2011, Big Switch Networks, Inc.
3 * Originally created by David Erickson & Rob Sherwood, Stanford University
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may
6 * not use this file except in compliance with the License. You may obtain
7 * a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations
18 package org.openflow.protocol.vendor;
20 import org.openflow.protocol.Instantiable;
23 * Class that represents a specific vendor data type format in an
24 * OFVendor message. Typically the vendor data will begin with an integer
25 * code that determines the format of the rest of the data, but this
26 * class does not assume that. It's basically just a holder for an
27 * instantiator of the appropriate subclass of OFVendorData.
29 * @author Rob Vaterlaus (rob.vaterlaus@bigswitch.com)
31 public class OFVendorDataType {
34 * Object that instantiates the subclass of OFVendorData
35 * associated with this data type.
37 protected Instantiable<OFVendorData> instantiable;
40 * Construct an empty vendor data type.
42 public OFVendorDataType() {
47 * Construct a vendor data type with the specified instantiable.
48 * @param instantiable object that creates the subclass of OFVendorData
49 * associated with this data type.
51 public OFVendorDataType(Instantiable<OFVendorData> instantiable) {
52 this.instantiable = instantiable;
56 * Returns a new instance of a subclass of OFVendorData associated with
57 * this OFVendorDataType.
59 * @return the new object
61 public OFVendorData newInstance() {
62 return instantiable.instantiate();
66 * @return the instantiable
68 public Instantiable<OFVendorData> getInstantiable() {
73 * @param instantiable the instantiable to set
75 public void setInstantiable(Instantiable<OFVendorData> instantiable) {
76 this.instantiable = instantiable;