X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflow-protocol-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fapi%2Fkeys%2FInstructionSerializerKey.java;h=89f5cbfead224753c5ea94f54ef9ca77ba8f750f;hb=2b5094b8ffd0e06dfaad372437e01ff1bd194623;hp=899568dc24ae3ac9457bc33f571f92a553eb8f26;hpb=0b1daa34f49ab93e08b5be06b50424c81efd0c82;p=openflowjava.git diff --git a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionSerializerKey.java b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionSerializerKey.java index 899568dc..89f5cbfe 100644 --- a/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionSerializerKey.java +++ b/openflow-protocol-api/src/main/java/org/opendaylight/openflowjava/protocol/api/keys/InstructionSerializerKey.java @@ -1,74 +1,80 @@ -/* - * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * 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.api.keys; - -import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction; -import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.InstructionBase; - -/** - * @author michal.polkorab - * @param action type - */ -public class InstructionSerializerKey - extends MessageTypeKey{ - - private Class instructionType; - private Long experimenterId; - - /** - * @param msgVersion protocol wire version - * @param objectType class of serialized object (Instruction.class) - * @param instructionType type of instruction - * @param experimenterId experimenter / vendor ID - */ - public InstructionSerializerKey(short msgVersion, Class instructionType, - Long experimenterId) { - super(msgVersion, Instruction.class); - this.instructionType = instructionType; - this.experimenterId = experimenterId; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode()); - result = prime * result + ((instructionType == null) ? 0 : instructionType.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (!super.equals(obj)) - return false; - if (!(obj instanceof InstructionSerializerKey)) - return false; - InstructionSerializerKey other = (InstructionSerializerKey) obj; - if (experimenterId == null) { - if (other.experimenterId != null) - return false; - } else if (!experimenterId.equals(other.experimenterId)) - return false; - if (instructionType == null) { - if (other.instructionType != null) - return false; - } else if (!instructionType.equals(other.instructionType)) - return false; - return true; - } - - @Override - public String toString() { - return super.toString() + " instructionType type: " + instructionType.getName() - + " vendorID: " + experimenterId; - } +/* + * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * 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.api.keys; + +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.InstructionChoice; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction; + +/** + * @author michal.polkorab + * @param instruction type + */ +public class InstructionSerializerKey + extends MessageTypeKey implements ExperimenterSerializerKey { + + private Class instructionType; + private Long experimenterId; + + /** + * @param msgVersion protocol wire version + * @param objectType class of serialized object (Instruction.class) + * @param instructionType type of instruction + * @param experimenterId experimenter / vendor ID + */ + public InstructionSerializerKey(short msgVersion, Class instructionType, + Long experimenterId) { + super(msgVersion, Instruction.class); + this.instructionType = instructionType; + this.experimenterId = experimenterId; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((experimenterId == null) ? 0 : experimenterId.hashCode()); + result = prime * result + ((instructionType == null) ? 0 : instructionType.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (!(obj instanceof InstructionSerializerKey)) { + return false; + } + InstructionSerializerKey other = (InstructionSerializerKey) obj; + if (experimenterId == null) { + if (other.experimenterId != null) { + return false; + } + } else if (!experimenterId.equals(other.experimenterId)) { + return false; + } + if (instructionType == null) { + if (other.instructionType != null) { + return false; + } + } else if (!instructionType.equals(other.instructionType)) { + return false; + } + return true; + } + + @Override + public String toString() { + return super.toString() + " instructionType type: " + instructionType.getName() + + " vendorID: " + experimenterId; + } } \ No newline at end of file