X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fsal%2Fapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Faction%2FActionType.java;h=b491c5fcea2e4b53914102a91e88a76591ac5d22;hb=237237663265bfda9069c66151371ce7697aed59;hp=0e085473d5513d929a9c18a3cd5fad3b087e67fd;hpb=2ed2e3f076e2d3bdab22fdcb94672d850c6c64a8;p=controller.git diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/ActionType.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/ActionType.java index 0e085473d5..b491c5fcea 100644 --- a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/ActionType.java +++ b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/ActionType.java @@ -1,4 +1,3 @@ - /* * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. * @@ -12,9 +11,6 @@ package org.opendaylight.controller.sal.action; /** * The enumeration of actions supported by the controller * Each entry has a unique id and the values range for the action element where applicable - * - * - * */ public enum ActionType { DROP("drop", 0, 0), @@ -61,8 +57,7 @@ public enum ActionType { } public String getRange() { - return "[0x" + Long.toHexString(minValue) + "-0x" - + Long.toHexString(maxValue) + "]"; + return "[0x" + Long.toHexString(minValue) + "-0x" + Long.toHexString(maxValue) + "]"; } public boolean takesParameter() { @@ -80,4 +75,12 @@ public enum ActionType { return true; } } -} \ No newline at end of file + + public int calculateConsistentHashCode() { + if (this.id != null) { + return this.id.hashCode(); + } else { + return 0; + } + } +}