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-2025 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 * @author <a href="https://www.tudelft.nl/averbraeck">Alexander Verbraeck</a>
12 * @author <a href="https://www.tudelft.nl/staff/p.knoppers/">Peter Knoppers</a>
13 * @param <T> type of object that implements this interface
14 */
15 public interface SerializableObject<T>
16 {
17 /**
18 * Make all elements that need to be serialized available as a list. The size of this list and the types of the elements in
19 * it <b>must</b> be consistent. Meaning that the size of the list and content types of the list are always the same.
20 * @return list of the elements that need to serialized
21 */
22 List<Object> exportAsList();
23
24 }