37 lines
837 B
Java
37 lines
837 B
Java
|
package cc.fascinated.bat.common;
|
||
|
|
||
|
import com.google.gson.Gson;
|
||
|
import lombok.Getter;
|
||
|
import lombok.NoArgsConstructor;
|
||
|
import lombok.Setter;
|
||
|
import org.bson.Document;
|
||
|
|
||
|
/**
|
||
|
* @author Fascinated (fascinated7)
|
||
|
*/
|
||
|
@Setter
|
||
|
@Getter
|
||
|
@NoArgsConstructor
|
||
|
public abstract class Serializable {
|
||
|
/**
|
||
|
* Load data from the provided document into this profile
|
||
|
*
|
||
|
* @param document the document to load data from
|
||
|
* @param gson the GSON instance to use
|
||
|
*/
|
||
|
public abstract void load(Document document, Gson gson);
|
||
|
|
||
|
/**
|
||
|
* Serialize this profile into a Bson document
|
||
|
*
|
||
|
* @param gson the GSON instance to use
|
||
|
* @return the serialized document
|
||
|
*/
|
||
|
public abstract Document serialize(Gson gson);
|
||
|
|
||
|
/**
|
||
|
* Resets the profile to its default state
|
||
|
*/
|
||
|
public abstract void reset();
|
||
|
}
|