blob: b92c4cab27405aafe61424551c88f498233abb3e [file] [log] [blame]
Tunahan Sezen03e55272020-04-18 09:18:53 +00001/*
Joey Armstrong53fcac22023-01-11 13:25:01 -05002 * Copyright 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors
Tunahan Sezen03e55272020-04-18 09:18:53 +00003 *
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 */
16package org.opencord.maclearner.api;
17
18import org.apache.commons.lang.builder.ToStringBuilder;
19import org.onosproject.event.AbstractEvent;
20
21/**
22 * Entity that represents Mac Learner events.
23 */
24public 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}