Added init annotation and method for boon's.
This commit is contained in:
parent
08de7c0f4f
commit
5a0b3978d1
18 changed files with 61 additions and 26 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package love.distributedrebirth.bassboonyd;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -18,6 +19,18 @@ public interface BãßBȍőnCoffinOpenʸᴰ<T extends BãßBȍőnCoffinStoreKey
|
|||
PUT_OBJ(key, new HashMap<>());
|
||||
}
|
||||
|
||||
default void INIT_BOON(Object boon) {
|
||||
try {
|
||||
for (Method m:boon.getClass().getMethods()) {
|
||||
if (m.isAnnotationPresent(BãßBȍőnInitMethodʸᴰ.class)) {
|
||||
m.invoke(boon, this);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
static <Y extends BãßBȍőnCoffinStoreKeyʸᴰ> BãßBȍőnCoffinOpenʸᴰ<Y> newInstance() {
|
||||
return new BãßBȍőnCoffinOpenʸᴰ<Y>() {
|
||||
final Map<Y,Object> initMap = new HashMap<>();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
package love.distributedrebirth.bassboonyd;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.METHOD})
|
||||
public @interface BãßBȍőnInitMethodʸᴰ {
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue