blob: 753708bbd2daac894e5659332d8dc607db299cf8 [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 of_class.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.slf4j.Logger;
27import org.slf4j.LoggerFactory;
28import java.util.Set;
29import org.jboss.netty.buffer.ChannelBuffer;
30import com.google.common.hash.PrimitiveSink;
31import com.google.common.hash.Funnel;
32
33class OFBsnSwitchPipelineStatsEntryVer13 implements OFBsnSwitchPipelineStatsEntry {
34 private static final Logger logger = LoggerFactory.getLogger(OFBsnSwitchPipelineStatsEntryVer13.class);
35 // version: 1.3
36 final static byte WIRE_VERSION = 4;
37 final static int LENGTH = 256;
38
39 private final static String DEFAULT_PIPELINE = "";
40
41 // OF message fields
42 private final String pipeline;
43//
44 // Immutable default instance
45 final static OFBsnSwitchPipelineStatsEntryVer13 DEFAULT = new OFBsnSwitchPipelineStatsEntryVer13(
46 DEFAULT_PIPELINE
47 );
48
49 // package private constructor - used by readers, builders, and factory
50 OFBsnSwitchPipelineStatsEntryVer13(String pipeline) {
51 this.pipeline = pipeline;
52 }
53
54 // Accessors for OF message fields
55 @Override
56 public String getPipeline() {
57 return pipeline;
58 }
59
60 @Override
61 public OFVersion getVersion() {
62 return OFVersion.OF_13;
63 }
64
65
66
67 public OFBsnSwitchPipelineStatsEntry.Builder createBuilder() {
68 return new BuilderWithParent(this);
69 }
70
71 static class BuilderWithParent implements OFBsnSwitchPipelineStatsEntry.Builder {
72 final OFBsnSwitchPipelineStatsEntryVer13 parentMessage;
73
74 // OF message fields
75 private boolean pipelineSet;
76 private String pipeline;
77
78 BuilderWithParent(OFBsnSwitchPipelineStatsEntryVer13 parentMessage) {
79 this.parentMessage = parentMessage;
80 }
81
82 @Override
83 public String getPipeline() {
84 return pipeline;
85 }
86
87 @Override
88 public OFBsnSwitchPipelineStatsEntry.Builder setPipeline(String pipeline) {
89 this.pipeline = pipeline;
90 this.pipelineSet = true;
91 return this;
92 }
93 @Override
94 public OFVersion getVersion() {
95 return OFVersion.OF_13;
96 }
97
98
99
100 @Override
101 public OFBsnSwitchPipelineStatsEntry build() {
102 String pipeline = this.pipelineSet ? this.pipeline : parentMessage.pipeline;
103 if(pipeline == null)
104 throw new NullPointerException("Property pipeline must not be null");
105
106 //
107 return new OFBsnSwitchPipelineStatsEntryVer13(
108 pipeline
109 );
110 }
111
112 }
113
114 static class Builder implements OFBsnSwitchPipelineStatsEntry.Builder {
115 // OF message fields
116 private boolean pipelineSet;
117 private String pipeline;
118
119 @Override
120 public String getPipeline() {
121 return pipeline;
122 }
123
124 @Override
125 public OFBsnSwitchPipelineStatsEntry.Builder setPipeline(String pipeline) {
126 this.pipeline = pipeline;
127 this.pipelineSet = true;
128 return this;
129 }
130 @Override
131 public OFVersion getVersion() {
132 return OFVersion.OF_13;
133 }
134
135//
136 @Override
137 public OFBsnSwitchPipelineStatsEntry build() {
138 String pipeline = this.pipelineSet ? this.pipeline : DEFAULT_PIPELINE;
139 if(pipeline == null)
140 throw new NullPointerException("Property pipeline must not be null");
141
142
143 return new OFBsnSwitchPipelineStatsEntryVer13(
144 pipeline
145 );
146 }
147
148 }
149
150
151 final static Reader READER = new Reader();
152 static class Reader implements OFMessageReader<OFBsnSwitchPipelineStatsEntry> {
153 @Override
154 public OFBsnSwitchPipelineStatsEntry readFrom(ChannelBuffer bb) throws OFParseError {
155 String pipeline = ChannelUtils.readFixedLengthString(bb, 256);
156
157 OFBsnSwitchPipelineStatsEntryVer13 bsnSwitchPipelineStatsEntryVer13 = new OFBsnSwitchPipelineStatsEntryVer13(
158 pipeline
159 );
160 if(logger.isTraceEnabled())
161 logger.trace("readFrom - read={}", bsnSwitchPipelineStatsEntryVer13);
162 return bsnSwitchPipelineStatsEntryVer13;
163 }
164 }
165
166 public void putTo(PrimitiveSink sink) {
167 FUNNEL.funnel(this, sink);
168 }
169
170 final static OFBsnSwitchPipelineStatsEntryVer13Funnel FUNNEL = new OFBsnSwitchPipelineStatsEntryVer13Funnel();
171 static class OFBsnSwitchPipelineStatsEntryVer13Funnel implements Funnel<OFBsnSwitchPipelineStatsEntryVer13> {
172 private static final long serialVersionUID = 1L;
173 @Override
174 public void funnel(OFBsnSwitchPipelineStatsEntryVer13 message, PrimitiveSink sink) {
175 sink.putUnencodedChars(message.pipeline);
176 }
177 }
178
179
180 public void writeTo(ChannelBuffer bb) {
181 WRITER.write(bb, this);
182 }
183
184 final static Writer WRITER = new Writer();
185 static class Writer implements OFMessageWriter<OFBsnSwitchPipelineStatsEntryVer13> {
186 @Override
187 public void write(ChannelBuffer bb, OFBsnSwitchPipelineStatsEntryVer13 message) {
188 ChannelUtils.writeFixedLengthString(bb, message.pipeline, 256);
189
190
191 }
192 }
193
194 @Override
195 public String toString() {
196 StringBuilder b = new StringBuilder("OFBsnSwitchPipelineStatsEntryVer13(");
197 b.append("pipeline=").append(pipeline);
198 b.append(")");
199 return b.toString();
200 }
201
202 @Override
203 public boolean equals(Object obj) {
204 if (this == obj)
205 return true;
206 if (obj == null)
207 return false;
208 if (getClass() != obj.getClass())
209 return false;
210 OFBsnSwitchPipelineStatsEntryVer13 other = (OFBsnSwitchPipelineStatsEntryVer13) obj;
211
212 if (pipeline == null) {
213 if (other.pipeline != null)
214 return false;
215 } else if (!pipeline.equals(other.pipeline))
216 return false;
217 return true;
218 }
219
220 @Override
221 public int hashCode() {
222 final int prime = 31;
223 int result = 1;
224
225 result = prime * result + ((pipeline == null) ? 0 : pipeline.hashCode());
226 return result;
227 }
228
229}