blob: 3faf113b985af5a7fc91ed9d402744fcb944ba21 [file] [log] [blame]
tom0eb04ca2014-08-25 14:34:51 -07001// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
2// Copyright (c) 2011, 2012 Open Networking Foundation
3// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
4// This library was generated by the LoxiGen Compiler.
5// See the file LICENSE.txt which should have been included in the source distribution
6
7// Automatically generated by LOXI from template const_serializer.java
8// Do not modify
9
10package org.projectfloodlight.openflow.protocol.ver10;
11
12import org.projectfloodlight.openflow.protocol.*;
13import org.projectfloodlight.openflow.protocol.action.*;
14import org.projectfloodlight.openflow.protocol.actionid.*;
15import org.projectfloodlight.openflow.protocol.bsntlv.*;
16import org.projectfloodlight.openflow.protocol.errormsg.*;
17import org.projectfloodlight.openflow.protocol.meterband.*;
18import org.projectfloodlight.openflow.protocol.instruction.*;
19import org.projectfloodlight.openflow.protocol.instructionid.*;
20import org.projectfloodlight.openflow.protocol.match.*;
21import org.projectfloodlight.openflow.protocol.oxm.*;
22import org.projectfloodlight.openflow.protocol.queueprop.*;
23import org.projectfloodlight.openflow.types.*;
24import org.projectfloodlight.openflow.util.*;
25import org.projectfloodlight.openflow.exceptions.*;
26import org.projectfloodlight.openflow.protocol.OFBsnPduSlotNumT;
27import org.jboss.netty.buffer.ChannelBuffer;
28import com.google.common.hash.PrimitiveSink;
29
30public class OFBsnPduSlotNumTSerializerVer10 {
31
32 public final static byte PDU_SLOT_NUM_ANY_VAL = (byte) 0xff;
33
34 public static OFBsnPduSlotNumT readFrom(ChannelBuffer bb) throws OFParseError {
35 try {
36 return ofWireValue(bb.readByte());
37 } catch (IllegalArgumentException e) {
38 throw new OFParseError(e);
39 }
40 }
41
42 public static void writeTo(ChannelBuffer bb, OFBsnPduSlotNumT e) {
43 bb.writeByte(toWireValue(e));
44 }
45
46 public static void putTo(OFBsnPduSlotNumT e, PrimitiveSink sink) {
47 sink.putByte(toWireValue(e));
48 }
49
50 public static OFBsnPduSlotNumT ofWireValue(byte val) {
51 switch(val) {
52 case PDU_SLOT_NUM_ANY_VAL:
53 return OFBsnPduSlotNumT.PDU_SLOT_NUM_ANY;
54 default:
55 throw new IllegalArgumentException("Illegal wire value for type OFBsnPduSlotNumT in version 1.0: " + val);
56 }
57 }
58
59
60 public static byte toWireValue(OFBsnPduSlotNumT e) {
61 switch(e) {
62 case PDU_SLOT_NUM_ANY:
63 return PDU_SLOT_NUM_ANY_VAL;
64 default:
65 throw new IllegalArgumentException("Illegal enum value for type OFBsnPduSlotNumT in version 1.0: " + e);
66 }
67 }
68
69}