Method names used as provider identifiers

This commit is contained in:
Rsl1122 2019-03-13 10:50:54 +02:00
parent 245c083237
commit a52954dbb8
2 changed files with 38 additions and 0 deletions

View File

@ -36,6 +36,10 @@ package com.djrapitops.plan.extension;
* {@link Group group} - Provided group the data is about (In case a group needs additional information)
* nothing - The data is interpreted to be about the server.
* <p>
* The name of the method will be used as an identifier in the database, so that a single provider does not duplicate entries.
* Only first 50 characters of the method name are stored.
* If you need to change a method name add a class annotation with the old method name: {@link com.djrapitops.plan.extension.annotation.InvalidateMethod}
* <p>
* Some additional annotations are available for controlling appearance of the results:
* {@link com.djrapitops.plan.extension.annotation.Conditional} A {@code boolean} returned by {@link com.djrapitops.plan.extension.annotation.BooleanProvider} has to be {@code true} for this method to be called.
* {@link com.djrapitops.plan.extension.annotation.Tab} The value of this provider should be placed on a tab with a specific name

View File

@ -0,0 +1,34 @@
package com.djrapitops.plan.extension.annotation;
import java.lang.annotation.*;
/**
* Annotation used to invalidate old method values.
* <p>
* The name of the methods are used as an identifier in the database, so that a single provider does not duplicate entries.
* Only first 50 characters of the method name are stored.
* If you need to change a method name add this class annotation with the old method name.
*
* @author Rsl1122
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Repeatable(InvalidateMethod.Multiple.class)
public @interface InvalidateMethod {
/**
* Name of the old method, values of which should be removed from the database.
*
* @return Name of the old method, case sensitive. Only first 50 characters are used.
*/
String value();
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@interface Multiple {
InvalidateMethod[] value();
}
}