bcb45d3dd7880a66d7851fec916e8ca143e51ead
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / main / java / org / opendaylight / controller / cluster / raft / protobuff / client / messages / CompositeModificationPayload.java
1 /*
2  * Copyright (c) 2014 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
9 package org.opendaylight.controller.cluster.raft.protobuff.client.messages;
10
11 import com.google.common.base.Preconditions;
12 import java.io.Serializable;
13 import org.opendaylight.controller.protobuff.messages.persistent.PersistentMessages;
14
15 @Deprecated
16 public class CompositeModificationPayload extends Payload implements
17     Serializable {
18
19     private final PersistentMessages.CompositeModification modification;
20
21     public CompositeModificationPayload(){
22         modification = null;
23     }
24     public CompositeModificationPayload(Object modification){
25         this.modification = (PersistentMessages.CompositeModification) Preconditions.checkNotNull(modification, "modification should not be null");
26     }
27
28     public Object getModification(){
29         return this.modification;
30     }
31
32     @Override
33     public int size(){
34         return this.modification.getSerializedSize();
35     }
36 }