Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 1 | package net.onrc.onos.core.matchaction.action; |
| 2 | |
Toshio Koide | bf8f865 | 2014-08-19 16:34:24 -0700 | [diff] [blame] | 3 | import java.util.Objects; |
| 4 | |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 5 | /** |
| 6 | * An action object to modify lambda. |
| 7 | * <p> |
| 8 | * This class does not have a switch ID. The switch ID is handled by |
Toshio Koide | 7894ca0 | 2014-08-15 14:30:13 -0700 | [diff] [blame] | 9 | * MatchAction, Flow or Intent class. |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 10 | */ |
Toshio Koide | d8b077a | 2014-08-13 10:47:21 -0700 | [diff] [blame] | 11 | public class ModifyLambdaAction implements Action { |
Toshio Koide | bf8f865 | 2014-08-19 16:34:24 -0700 | [diff] [blame] | 12 | private final int lambda; |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 13 | |
| 14 | /** |
| 15 | * Constructor. |
| 16 | * |
Yuta HIGUCHI | ccab05d | 2014-07-26 22:42:28 -0700 | [diff] [blame] | 17 | * @param lambda lambda after modification |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 18 | */ |
| 19 | public ModifyLambdaAction(int lambda) { |
| 20 | this.lambda = lambda; |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * Gets the lambda. |
| 25 | * |
| 26 | * @return The lambda. |
| 27 | */ |
| 28 | public int getLambda() { |
| 29 | return lambda; |
| 30 | } |
| 31 | |
Toshio Koide | bf8f865 | 2014-08-19 16:34:24 -0700 | [diff] [blame] | 32 | @Override |
| 33 | public int hashCode() { |
| 34 | return Objects.hashCode(lambda); |
| 35 | } |
| 36 | |
| 37 | @Override |
| 38 | public boolean equals(Object obj) { |
| 39 | if (this == obj) { |
| 40 | return true; |
| 41 | } |
| 42 | if (obj == null || getClass() != obj.getClass()) { |
| 43 | return false; |
| 44 | } |
| 45 | ModifyLambdaAction other = (ModifyLambdaAction) obj; |
| 46 | return lambda == other.lambda; |
| 47 | } |
| 48 | |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 49 | } |