2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.protocol.concepts;
11 * Interface marking object which hold some state, which can be captured and saved. Capturing this state is useful for
12 * various entities which need to see a consistent, point-in-time view of the state.
14 * @param <T> Type reference of the returned state object
16 public interface Stateful<T extends State> {
18 * Return a reference to the current state of the object. The returned object must remain immutable throughout its
19 * lifetime. Furthermore using equals() on two state objects returned from this method must return true if and only
20 * if the internal state of this object the the two points was equivalent.
22 * @return Reference to a point-in-time consistent state of the object.
24 public T currentState();