Fix modernization issues
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / DataTreeChanged.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.cluster.datastore.messages;
9
10 import static java.util.Objects.requireNonNull;
11
12 import java.util.Collection;
13 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate;
14
15 /**
16  * A message about a DataTree having been changed. The message is not
17  * serializable on purpose. For delegating the change across cluster nodes,
18  * this needs to be intercepted by a local agent and forwarded as reconstructed
19  * candidate.
20  */
21 public final class DataTreeChanged {
22     private final Collection<DataTreeCandidate> changes;
23
24     public DataTreeChanged(final Collection<DataTreeCandidate> changes) {
25         this.changes = requireNonNull(changes);
26     }
27
28     /**
29      * Return the data changes.
30      *
31      * @return Change events
32      */
33     public Collection<DataTreeCandidate> getChanges() {
34         return changes;
35     }
36 }