blob: ee784819d8c80e151ce4c4b7275fee6b6b940bea [file] [log] [blame]
Toshio Koidea03915e2014-07-01 18:39:52 -07001package net.onrc.onos.core.matchaction.action;
2
Toshio Koidebf8f8652014-08-19 16:34:24 -07003import java.util.Objects;
4
Toshio Koidea03915e2014-07-01 18:39:52 -07005/**
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 Koide7894ca02014-08-15 14:30:13 -07009 * MatchAction, Flow or Intent class.
Toshio Koidea03915e2014-07-01 18:39:52 -070010 */
Toshio Koided8b077a2014-08-13 10:47:21 -070011public class ModifyLambdaAction implements Action {
Toshio Koidebf8f8652014-08-19 16:34:24 -070012 private final int lambda;
Toshio Koidea03915e2014-07-01 18:39:52 -070013
14 /**
15 * Constructor.
16 *
Yuta HIGUCHIccab05d2014-07-26 22:42:28 -070017 * @param lambda lambda after modification
Toshio Koidea03915e2014-07-01 18:39:52 -070018 */
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 Koidebf8f8652014-08-19 16:34:24 -070032 @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 Koidea03915e2014-07-01 18:39:52 -070049}