blob: a8a3ffb7bd40e19f6929f7a5fd5190e70395ebc6 [file] [log] [blame]
tom7ef8ff92014-09-17 13:08:06 -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.ver13;
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.OFBsnVrfCounterConstants;
27import org.jboss.netty.buffer.ChannelBuffer;
28import com.google.common.hash.PrimitiveSink;
29
30public class OFBsnVrfCounterConstantsSerializerVer13 {
31
32 public final static int BSN_VRF_ALL_VAL = (int) 0xffffffff;
33
34 public static OFBsnVrfCounterConstants readFrom(ChannelBuffer bb) throws OFParseError {
35 try {
36 return ofWireValue(bb.readInt());
37 } catch (IllegalArgumentException e) {
38 throw new OFParseError(e);
39 }
40 }
41
42 public static void writeTo(ChannelBuffer bb, OFBsnVrfCounterConstants e) {
43 bb.writeInt(toWireValue(e));
44 }
45
46 public static void putTo(OFBsnVrfCounterConstants e, PrimitiveSink sink) {
47 sink.putInt(toWireValue(e));
48 }
49
50 public static OFBsnVrfCounterConstants ofWireValue(int val) {
51 switch(val) {
52 case BSN_VRF_ALL_VAL:
53 return OFBsnVrfCounterConstants.BSN_VRF_ALL;
54 default:
55 throw new IllegalArgumentException("Illegal wire value for type OFBsnVrfCounterConstants in version 1.3: " + val);
56 }
57 }
58
59
60 public static int toWireValue(OFBsnVrfCounterConstants e) {
61 switch(e) {
62 case BSN_VRF_ALL:
63 return BSN_VRF_ALL_VAL;
64 default:
65 throw new IllegalArgumentException("Illegal enum value for type OFBsnVrfCounterConstants in version 1.3: " + e);
66 }
67 }
68
69}