001 package org.bukkit.configuration.serialization; 002 003 import java.lang.annotation.ElementType; 004 import java.lang.annotation.Retention; 005 import java.lang.annotation.RetentionPolicy; 006 import java.lang.annotation.Target; 007 008 /** 009 * Represents an "alias" that a {@link ConfigurationSerializable} may be 010 * stored as. 011 * If this is not present on a {@link ConfigurationSerializable} class, it 012 * will use the fully qualified name of the class. 013 * <p> 014 * This value will be stored in the configuration so that the configuration 015 * deserialization can determine what type it is. 016 * <p> 017 * Using this annotation on any other class than a {@link 018 * ConfigurationSerializable} will have no effect. 019 * 020 * @see ConfigurationSerialization#registerClass(Class, String) 021 */ 022 @Retention(RetentionPolicy.RUNTIME) 023 @Target(ElementType.TYPE) 024 public @interface SerializableAs { 025 /** 026 * This is the name your class will be stored and retrieved as. 027 * <p> 028 * This name MUST be unique. We recommend using names such as 029 * "MyPluginThing" instead of "Thing". 030 * 031 * @return Name to serialize the class as. 032 */ 033 public String value(); 034 }