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 org.eclipse.jdt.annotation.NonNull;
14 * Abstract factory class to support OF protocol version assigning and reading.
16 public abstract class VersionAssignableFactory {
17 private Short version;
20 * Assigns the version.
22 * @param newVersion OpenFlow protocol version
24 public void assignVersion(@NonNull final Short newVersion) {
25 if (this.version == null) {
26 this.version = newVersion;
28 throw new IllegalStateException("Version already assigned: " + this.version);
33 * Returns the OpenFlow protocol version.
35 protected Short getVersion() {