1 package org.djutils.serialization; 2 3 import java.util.List; 4 5 /** 6 * Interface that must be implemented by objects that can be serialized. 7 * <p> 8 * Copyright (c) 2019-2023 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br> 9 * BSD-style license. See <a href="https://djutils.org/docs/current/djutils/licenses.html">DJUTILS License</a>. 10 * <p> 11 * @version $Revision$, $LastChangedDate$, by $Author$, <br> 12 * @author <a href="https://www.tudelft.nl/averbraeck">Alexander Verbraeck</a> 13 * @author <a href="https://www.tudelft.nl/staff/p.knoppers/">Peter Knoppers</a> 14 * @param <T> type of object that implements this interface 15 */ 16 public interface SerializableObject<T> 17 { 18 /** 19 * Make all elements that need to be serialized available as a list. The size of this list and the types of the elements in 20 * it <b>must</b> be consistent. Meaning that the size of the list and content types of the list are always the same. 21 * @return List<Object>; list of the elements that need to serialized 22 */ 23 List<Object> exportAsList(); 24 25 }