* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.protocol.impl.serialization.action;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.ExperimenterIdCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.experimenter.id.match.entry.ExperimenterIdCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.ExperimenterClass;
@Override
@SuppressFBWarnings("UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR") // FB doesn't recognize Objects.requireNonNull
- public void serialize(Action action, ByteBuf outBuffer) {
+ public void serialize(final Action action, final ByteBuf outBuffer) {
Objects.requireNonNull(registry);
final int startIndex = outBuffer.writerIndex();
MatchEntry entry = ((SetFieldCase) action.getActionChoice()).getSetFieldAction()
.getMatchEntry().get(0);
MatchEntrySerializerKey<?, ?> key = new MatchEntrySerializerKey<>(
- EncodeConstants.OF13_VERSION_ID, entry.getOxmClass(), entry.getOxmMatchField());
- if (entry.getOxmClass().equals(ExperimenterClass.class)) {
+ EncodeConstants.OF_VERSION_1_3, entry.getOxmClass(), entry.getOxmMatchField());
+ if (ExperimenterClass.VALUE.equals(entry.getOxmClass())) {
ExperimenterIdCase experimenterIdCase = (ExperimenterIdCase) entry.getMatchEntryValue();
key.setExperimenterId(experimenterIdCase.getExperimenter().getExperimenter().getValue());
} else {
}
@Override
- public void serializeHeader(Action input, ByteBuf outBuffer) {
+ public void serializeHeader(final Action input, final ByteBuf outBuffer) {
outBuffer.writeShort(ActionConstants.SET_FIELD_CODE);
outBuffer.writeShort(ActionConstants.ACTION_IDS_LENGTH);
}
@Override
- public void injectSerializerRegistry(SerializerRegistry serializerRegistry) {
+ public void injectSerializerRegistry(final SerializerRegistry serializerRegistry) {
registry = serializerRegistry;
}
-
}