Tunahan Sezen | 03e5527 | 2020-04-18 09:18:53 +0000 | [diff] [blame] | 1 | /* |
Joey Armstrong | 53fcac2 | 2023-01-11 13:25:01 -0500 | [diff] [blame^] | 2 | * Copyright 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors |
Tunahan Sezen | 03e5527 | 2020-04-18 09:18:53 +0000 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package org.opencord.maclearner.api; |
| 17 | |
| 18 | import org.apache.commons.lang.builder.ToStringBuilder; |
| 19 | import org.onosproject.event.AbstractEvent; |
| 20 | |
| 21 | /** |
| 22 | * Entity that represents Mac Learner events. |
| 23 | */ |
| 24 | public class MacLearnerEvent extends AbstractEvent<MacLearnerEvent.Type, MacLearner> { |
| 25 | |
| 26 | public enum Type { |
| 27 | |
| 28 | /** |
| 29 | * New entry added to MacLearnerMap. |
| 30 | */ |
| 31 | ADDED, |
| 32 | /** |
| 33 | * An entry removed from MacLearnerMap. |
| 34 | */ |
| 35 | REMOVED, |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Creates an event due to mac learner map update. |
| 40 | * @param type type of event |
| 41 | * @param macLearner mac learner object |
| 42 | */ |
| 43 | public MacLearnerEvent(MacLearnerEvent.Type type, MacLearner macLearner) { |
| 44 | super(type, macLearner); |
| 45 | } |
| 46 | |
| 47 | @Override |
| 48 | public String toString() { |
| 49 | return new ToStringBuilder(this) |
| 50 | .append(super.toString()) |
| 51 | .toString(); |
| 52 | } |
| 53 | |
| 54 | } |