Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
ConfigurationSerializable.java
1 package org.bukkit.configuration.serialization;
2 
3 import java.util.Map;
4 
5 /**
6  * Represents an object that may be serialized.
7  * <p>
8  * These objects MUST implement one of the following, in addition to the
9  * methods as defined by this interface:
10  * <ul>
11  * <li>A static method "deserialize" that accepts a single {@link Map}&lt;
12  * {@link String}, {@link Object}> and returns the class.</li>
13  * <li>A static method "valueOf" that accepts a single {@link Map}&lt;{@link
14  * String}, {@link Object}> and returns the class.</li>
15  * <li>A constructor that accepts a single {@link Map}&lt;{@link String},
16  * {@link Object}>.</li>
17  * </ul>
18  * In addition to implementing this interface, you must register the class
19  * with {@link ConfigurationSerialization#registerClass(Class)}.
20  *
21  * @see DelegateDeserialization
22  * @see SerializableAs
23  */
24 public interface ConfigurationSerializable {
25 
26  /**
27  * Creates a Map representation of this class.
28  * <p>
29  * This class must provide a method to restore this class, as defined in
30  * the {@link ConfigurationSerializable} interface javadocs.
31  *
32  * @return Map containing the current state of this class
33  */
34  public Map<String, Object> serialize();
35 }