2 * Copyright (c) 2016 Pantheon Technologies s.r.o. 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.openflowjava.protocol.impl.util;
11 import javax.annotation.Nonnull;
14 * Abstract factory class to support OF protocol version assigning and reading.
16 public abstract class VersionAssignableFactory {
17 private Short version;
20 * @param version OpenFlow protocol version
22 public void assignVersion(@Nonnull final Short version) {
23 if (this.version == null) {
24 this.version = version;
26 throw new IllegalStateException("Version already assigned: " + this.version);
31 * @return OpenFlow protocol version
33 protected Short getVersion() {