bassbone
This commit is contained in:
parent
4f122133ce
commit
779e280b87
312 changed files with 1756 additions and 1621 deletions
|
|
@ -0,0 +1,201 @@
|
|||
package love.distributedrebirth.bassboon;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPirateLoader;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnꝐŕḯṿª₮ḕ;
|
||||
import love.distributedrebirth.bassboon.death.BãßBȍőnCoffin;
|
||||
import love.distributedrebirth.bassboon.death.BãßBȍőnCoffinGhost;
|
||||
import love.distributedrebirth.bassboon.death.BãßBȍőnCoffinGhostSpell;
|
||||
import love.distributedrebirth.bassboon.death.BãßBȍőnCoffinGhostSpellLock;
|
||||
import love.distributedrebirth.bassboon.death.spider.BãßBȍőnSpider;
|
||||
|
||||
/**
|
||||
* Runtime for static bass noise.
|
||||
*/
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface Bãß {
|
||||
|
||||
/**
|
||||
* Sarcophagus aggregates Y-Dimensions.
|
||||
*/
|
||||
public static final class 石棺ʸᴰ {
|
||||
private static final Map<Object, BȍőnGrave> GRAVE_YARD = new WeakHashMap<>();
|
||||
private static final ReadWriteLock FUNERAL = new ReentrantReadWriteLock();
|
||||
|
||||
/**
|
||||
* Sarcophagus is closed for humans.
|
||||
*/
|
||||
private 石棺ʸᴰ() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Mononoke Init
|
||||
*/
|
||||
public static final <T extends BãßBȍőnʸᴰ<T>> void 魎ᴵⁿᶦᵗ(BãßBȍőnʸᴰ<T> boon) {
|
||||
挖ᵀᵒ(boon).init(boon);
|
||||
}
|
||||
|
||||
/**
|
||||
* Grave Lock
|
||||
*/
|
||||
public static final <T extends BãßBȍőnʸᴰ<T>> void 墳ᴸᵒᶜᵏ(BãßBȍőnʸᴰ<T> boon) {
|
||||
挖ᵀᵒ(boon).lock(boon);
|
||||
}
|
||||
|
||||
/**
|
||||
* Coffin Of
|
||||
*/
|
||||
protected static final <T extends BãßBȍőnʸᴰ<T>> BãßBȍőnCoffin 棺ᴼᶠ(BãßBȍőnʸᴰ<T> boon) {
|
||||
return 挖ᵀᵒ(boon);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dig To
|
||||
*/
|
||||
private static final <T extends BãßBȍőnʸᴰ<T>> BȍőnGrave 挖ᵀᵒ(BãßBȍőnʸᴰ<T> boon) {
|
||||
BȍőnGrave boonGrave = null;
|
||||
Lock bibleReader = FUNERAL.readLock();
|
||||
bibleReader.lock();
|
||||
try {
|
||||
boonGrave = GRAVE_YARD.get(boon);
|
||||
} finally {
|
||||
bibleReader.unlock();
|
||||
}
|
||||
if (boonGrave == null) {
|
||||
Lock shemiraWriter = FUNERAL.writeLock();
|
||||
shemiraWriter.lock();
|
||||
try {
|
||||
boonGrave = new BȍőnGrave();
|
||||
GRAVE_YARD.put(boon, boonGrave);
|
||||
} finally {
|
||||
shemiraWriter.unlock();
|
||||
}
|
||||
}
|
||||
return boonGrave;
|
||||
}
|
||||
/*
|
||||
public static <T> BeanWrapper<T> 豆ᴺᴱᵂ(Class<T> seedling) { // bean-new
|
||||
try {
|
||||
T bean = seedling.getConstructor().newInstance();
|
||||
if (bean instanceof BãßBȍőnʸᴰ) {
|
||||
BãßBȍőnʸᴰ<?> boon = (BãßBȍőnʸᴰ<?>) bean;
|
||||
BȍőnGrave grave = 墳ᴼᶠ(boon);
|
||||
if (!grave.inited) {
|
||||
魎ᴵᴺᴵᵀ(boon);
|
||||
}
|
||||
return new BeanWrapper<>(bean);
|
||||
}
|
||||
BeanWrapper<T> wrap = new BeanWrapper<>(bean);
|
||||
魎ᴵᴺᴵᵀ(wrap);
|
||||
return wrap;
|
||||
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
|
||||
| InvocationTargetException | NoSuchMethodException | SecurityException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static final class BeanWrapper<T> implements DefaultBãßBȍőnʸᴰ<T> {
|
||||
private final T bean;
|
||||
|
||||
private BeanWrapper(T bean) {
|
||||
this.bean = bean;
|
||||
}
|
||||
|
||||
public T getBean() {
|
||||
return bean;
|
||||
}
|
||||
}
|
||||
*/
|
||||
private static final class BȍőnGrave implements BãßBȍőnCoffin {
|
||||
private final Map<Class<?>,BãßBȍőnCoffinGhost> ghosts;
|
||||
private final BãßBȍőnSpider spider;
|
||||
private boolean inited = false;
|
||||
private boolean locked = false;
|
||||
|
||||
private BȍőnGrave() {
|
||||
this.ghosts = new HashMap<>();
|
||||
this.spider = new BãßBȍőnSpider();
|
||||
}
|
||||
|
||||
private <T extends BãßBȍőnʸᴰ<T>> void init(BãßBȍőnʸᴰ<T> boon) {
|
||||
if (inited) {
|
||||
return;
|
||||
}
|
||||
BãßBȍőnPirateLoader.INIT_BONE_MAGIC(boon, spider);
|
||||
inited = true;
|
||||
}
|
||||
|
||||
private <T extends BãßBȍőnʸᴰ<T>> void lock(BãßBȍőnʸᴰ<T> boon) {
|
||||
if (locked) {
|
||||
return;
|
||||
}
|
||||
BãßBȍőnPirateLoader.LOCK_BONE_MAGIC(boon, spider);
|
||||
for (Class<?> familyName:new ArrayList<>(ghosts.keySet())) {
|
||||
BãßBȍőnCoffinGhost ghost = ghosts.get(familyName);
|
||||
ghosts.put(familyName, BãßBȍőnCoffinGhostSpellLock.castᴼᶠ(ghost).LOCK());
|
||||
}
|
||||
locked = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BãßBȍőnCoffinGhost UNHOLY(Class<? extends BãßBȍőnꝐŕḯṿª₮ḕ<?>> familyName) {
|
||||
BãßBȍőnCoffinGhost ghost = ghosts.get(familyName);
|
||||
if (ghost == null) {
|
||||
if (locked) {
|
||||
throw new RuntimeException("Coffin locked");
|
||||
}
|
||||
ghost = BãßBȍőnCoffinGhostSpellLock.instanceᴺᵉʷ();
|
||||
ghosts.put(familyName, ghost);
|
||||
}
|
||||
return ghost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BãßBȍőnCoffinGhostSpell UNHOLY_SPELL(Class<? extends BãßBȍőnꝐŕḯṿª₮ḕ<?>> familyName) {
|
||||
return BãßBȍőnCoffinGhostSpell.castᴼᶠ(UNHOLY(familyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//@ImportStatic(guard = true, reason = "Death to import static name space pollution.")
|
||||
public static final class ℭỗᶇṧⱦᶏꬼȶʂ {
|
||||
|
||||
// 4 is magnetic consent and 3 is forced stable outcome
|
||||
public static final char CHAR_ZERO = '0'; // nothing
|
||||
public static final char CHAR_ONE = '1'; // all
|
||||
public static final char CHAR_SPACE = ' '; // eatherspace
|
||||
public static final char CHAR_A = 'a'; // corner stone of creation
|
||||
// the nether
|
||||
public static final String STR_ZERO = "0"; //String.valueOf(CHAR_ZERO);
|
||||
public static final String STR_ONE = "1"; //String.valueOf(CHAR_ONE);
|
||||
public static final String STR_EMPTY = ""; //STR_ONE.substring(Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ONE);
|
||||
public static final String STR_SPACE = " "; //String.valueOf(CHAR_SPACE);
|
||||
// red
|
||||
public static final int INT_ZERO = 0; //Integer.valueOf(STR_ZERO);
|
||||
public static final int INT_ONE = 1; //Integer.valueOf(STR_ONE);
|
||||
public static final int INT_TEN = 10; //Integer.valueOf(STR_ONE+STR_ZERO);
|
||||
// white
|
||||
public static final long LONG_ZERO = 0l; //Long.valueOf(STR_ZERO);
|
||||
public static final long LONG_ONE = 1l; //Long.valueOf(STR_ONE);
|
||||
public static final long LONG_TEN = 10l; //Long.valueOf(STR_ONE+STR_ZERO);
|
||||
// blue
|
||||
public static final float FLOAT_ZERO = 0f; //Float.valueOf(STR_ZERO);
|
||||
public static final float FLOAT_ONE = 1f; //Float.valueOf(STR_ONE);
|
||||
public static final float FLOAT_TEN = 10f; //Float.valueOf(STR_ONE+STR_ZERO);
|
||||
// orange on top
|
||||
public static final double DOUBLE_ZERO = 0d; //Double.valueOf(STR_ZERO);
|
||||
public static final double DOUBLE_ONE = 1f; //Double.valueOf(STR_ONE);;
|
||||
public static final double DOUBLE_TEN = 10f; //Double.valueOf(STR_ONE+STR_ZERO);
|
||||
|
||||
private ℭỗᶇṧⱦᶏꬼȶʂ() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package love.distributedrebirth.bassboon;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
import love.distributedrebirth.bassboon.death.BãßBȍőnCoffin;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
//publicinterfaceBãßBȍőnʸᴰ<T⁽⁾> { // TODO: jvm recursive terminator² type sugar
|
||||
public interface BãßBȍőnʸᴰ<T extends BãßBȍőnʸᴰ<T>> {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default T toBȍőn() {
|
||||
return (T)this; // allow builders...
|
||||
}
|
||||
|
||||
default BãßBȍőnCoffin toBBC() {
|
||||
return Bãß.石棺ʸᴰ.棺ᴼᶠ(this); // ...to seek 6 bit BASIC death, so the blind can see
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package love.distributedrebirth.bassboon;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAnnotationʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthorʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnClazzʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnExportʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPirateʸᴰ;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface DefaultBãßBȍőnʸᴰ<T extends BãßBȍőnʸᴰ<T>> extends
|
||||
BãßBȍőnʸᴰ<T>,
|
||||
BãßBȍőnPirateʸᴰ<T>,
|
||||
BãßBȍőnClazzʸᴰ<T>,
|
||||
BãßBȍőnAuthorʸᴰ<T>,
|
||||
BãßBȍőnExportʸᴰ<T>,
|
||||
BãßBȍőnAnnotationʸᴰ<T>
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package love.distributedrebirth.bassboon;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnꝐŕḯṿª₮ḕ;
|
||||
|
||||
// Bȍőn prefix is for set instance enum methods (called DefaultEnumSetʸᴰ)
|
||||
// Bãß prefix is for single instance enum methods (called DefaultEnumInstanceʸᴰ)
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface DefaultEnumBaseʸᴰ<T extends BãßBȍőnʸᴰ<T>> extends DefaultBãßBȍőnʸᴰ<T> {
|
||||
|
||||
public static final class Ꝑŕḯṿª₮ḕ implements BãßBȍőnꝐŕḯṿª₮ḕ<DefaultEnumBaseʸᴰ<?>> {
|
||||
private static final String STR_VALUES = "values";
|
||||
|
||||
@Override
|
||||
public void init(DefaultEnumBaseʸᴰ<?> boon) {
|
||||
}
|
||||
}
|
||||
|
||||
int ordinal();
|
||||
|
||||
String name();
|
||||
|
||||
default String BȍőnNaam() {
|
||||
return name();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default T[] BãßInstances() {
|
||||
try {
|
||||
return (T[]) getClass().getMethod(Ꝑŕḯṿª₮ḕ.STR_VALUES).invoke(null);
|
||||
} catch (NoSuchMethodException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | SecurityException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package love.distributedrebirth.bassboon;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface DefaultEnumInstanceʸᴰ<T extends BãßBȍőnʸᴰ<T>> extends DefaultEnumBaseʸᴰ<T> {
|
||||
|
||||
default T BãßInstance() {
|
||||
return BãßInstances()[Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
package love.distributedrebirth.bassboon;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPiratePhase注;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPirateʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnꝐŕḯṿª₮ḕ;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface DefaultEnumSetʸᴰ<T extends BãßBȍőnʸᴰ<T>> extends DefaultEnumBaseʸᴰ<T> {
|
||||
|
||||
@BãßBȍőnPiratePhase注(dependencies = {BãßBȍőnPirateʸᴰ.βrahmanBoonBereshit.class})
|
||||
public static final class Ꝑŕḯṿª₮ḕ implements BãßBȍőnꝐŕḯṿª₮ḕ<DefaultEnumSetʸᴰ<?>> {
|
||||
private static final String GHOST_RANG_TEL_EEN = "秩數數一";
|
||||
|
||||
@Override
|
||||
public void init(DefaultEnumSetʸᴰ<?> boon) {
|
||||
boon.toBBC().UNHOLY_SPELL(Ꝑŕḯṿª₮ḕ.class).PUT_GHOST(GHOST_RANG_TEL_EEN, boon.BȍőnRangTelNul() + Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ONE);
|
||||
}
|
||||
}
|
||||
|
||||
default int BȍőnRangTelNul() {
|
||||
return ordinal();
|
||||
}
|
||||
|
||||
default int BȍőnRangTelEen() {
|
||||
return toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).GHOST_INT(Ꝑŕḯṿª₮ḕ.GHOST_RANG_TEL_EEN);
|
||||
}
|
||||
|
||||
default List<T> BãßInstancesList() {
|
||||
return Arrays.asList(BãßInstances());
|
||||
}
|
||||
|
||||
default Map<String,T> BãßInstancesToMap(Function<T,String> keyMapper) {
|
||||
return BãßInstancesList().stream().collect(Collectors.toMap(keyMapper, v -> v));
|
||||
}
|
||||
|
||||
default T BȍőnVolgende() {
|
||||
T[] values = BãßInstances();
|
||||
int resultIndex = Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO;
|
||||
for (int i=Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO;i<values.length;i++) {
|
||||
if (this == values[i]) {
|
||||
resultIndex = i + Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ONE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (resultIndex == values.length) {
|
||||
resultIndex = Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO;
|
||||
}
|
||||
return values[resultIndex];
|
||||
}
|
||||
|
||||
default T BȍőnVorige() {
|
||||
T[] values = BãßInstances();
|
||||
int resultIndex = Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO;
|
||||
for (int i=Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO;i<values.length;i++) {
|
||||
if (this == values[i]) {
|
||||
resultIndex = i - Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ONE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (resultIndex < Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO) {
|
||||
resultIndex = values.length - Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ONE;
|
||||
}
|
||||
return values[resultIndex];
|
||||
}
|
||||
|
||||
default void BãßVoorElk(Consumer<T> consumer) {
|
||||
for (T value:BãßInstances()) {
|
||||
consumer.accept(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package love.distributedrebirth.bassboon.clazz;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.util.LinkedHashSet;
|
||||
|
||||
import love.distributedrebirth.bassboon.BãßBȍőnʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPirateLoader;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPiratePhase注;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPirateʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnꝐŕḯṿª₮ḕ;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface BãßBȍőnAnnotationʸᴰ<T extends BãßBȍőnʸᴰ<T>> extends BãßBȍőnʸᴰ<T> {
|
||||
|
||||
@BãßBȍőnPiratePhase注(dependencies = {BãßBȍőnPirateʸᴰ.βrahmanBoonLaw.class})
|
||||
public static final class Ꝑŕḯṿª₮ḕ implements BãßBȍőnꝐŕḯṿª₮ḕ<BãßBȍőnAnnotationʸᴰ<?>> {
|
||||
|
||||
@Override
|
||||
public void init(BãßBȍőnAnnotationʸᴰ<?> boon) {
|
||||
for (Class<?> interfaceClass:BãßBȍőnPirateLoader.walkInterfaces(boon.getClass(), new LinkedHashSet<>())) {
|
||||
BãßBȍőnAnnotation注 anno = interfaceClass.getAnnotation(BãßBȍőnAnnotation注.class);
|
||||
if (anno == null) {
|
||||
continue;
|
||||
}
|
||||
for (Class<? extends Annotation> required:anno.required()) {
|
||||
if (!boon.getClass().isAnnotationPresent(required)) {
|
||||
throw new IllegalStateException("Missing required annotation: "+required.getSimpleName()+" on: "+boon.getClass().getSimpleName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package love.distributedrebirth.bassboon.clazz;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.TYPE})
|
||||
public @interface BãßBȍőnAnnotation注 {
|
||||
|
||||
Class<? extends Annotation>[] required() default {};
|
||||
|
||||
Class<? extends Annotation>[] optional() default {};
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package love.distributedrebirth.bassboon.clazz;
|
||||
|
||||
import love.distributedrebirth.bassboon.BãßBȍőnʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPiratePhase注;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPirateʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnꝐŕḯṿª₮ḕ;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
@BãßBȍőnAnnotation注(optional = {BãßBȍőnAuthor注.class})
|
||||
public interface BãßBȍőnAuthorʸᴰ<T extends BãßBȍőnʸᴰ<T>> extends BãßBȍőnʸᴰ<T> {
|
||||
|
||||
@BãßBȍőnPiratePhase注(dependencies = {BãßBȍőnPirateʸᴰ.βrahmanBoonLaw.class})
|
||||
public static final class Ꝑŕḯṿª₮ḕ implements BãßBȍőnꝐŕḯṿª₮ḕ<BãßBȍőnAuthorʸᴰ<?>> {
|
||||
private static final String GHOST_AUTHOR_NAME = "作者姓名";
|
||||
private static final String GHOST_AUTHOR_COPYRIGHT = "作者版權";
|
||||
private static final String DEFAULT_AUTHOR_NAME = "奴隸來自 仙上主天";
|
||||
private static final String DEFAULT_AUTHOR_COPYRIGHT = "©Δ∞ 仙上主天";
|
||||
|
||||
@Override
|
||||
public void init(BãßBȍőnAuthorʸᴰ<?> boon) {
|
||||
BãßBȍőnAuthor注 anno = boon.getClass().getAnnotation(BãßBȍőnAuthor注.class);
|
||||
boon.toBBC().UNHOLY_SPELL(Ꝑŕḯṿª₮ḕ.class).PUT_GHOST(GHOST_AUTHOR_NAME, anno!=null?anno.name():DEFAULT_AUTHOR_NAME);
|
||||
boon.toBBC().UNHOLY_SPELL(Ꝑŕḯṿª₮ḕ.class).PUT_GHOST(GHOST_AUTHOR_COPYRIGHT, anno!=null?anno.copyright():DEFAULT_AUTHOR_COPYRIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
default String BãßAuthorNaam() {
|
||||
return toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).GHOST_STR(Ꝑŕḯṿª₮ḕ.GHOST_AUTHOR_NAME);
|
||||
}
|
||||
|
||||
default String BãßAuthorKopieërRecht() {
|
||||
return toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).GHOST_STR(Ꝑŕḯṿª₮ḕ.GHOST_AUTHOR_COPYRIGHT);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package love.distributedrebirth.bassboon.clazz;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Moves copyright into runtime class info.
|
||||
*/
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.TYPE})
|
||||
public @interface BãßBȍőnAuthor注 {
|
||||
|
||||
String name();
|
||||
|
||||
String copyright();
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package love.distributedrebirth.bassboon.clazz;
|
||||
|
||||
import love.distributedrebirth.bassboon.BãßBȍőnʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPiratePhase注;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPirateʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnꝐŕḯṿª₮ḕ;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
@BãßBȍőnAnnotation注(optional = {BãßBȍőnClazz注.class})
|
||||
public interface BãßBȍőnClazzʸᴰ<T extends BãßBȍőnʸᴰ<T>> extends BãßBȍőnʸᴰ<T> {
|
||||
|
||||
@BãßBȍőnPiratePhase注(dependencies = {BãßBȍőnPirateʸᴰ.βrahmanBoonLaw.class})
|
||||
public static final class Ꝑŕḯṿª₮ḕ implements BãßBȍőnꝐŕḯṿª₮ḕ<BãßBȍőnClazzʸᴰ<?>> {
|
||||
private static final String GHOST_CLAZZ_PURPOSE = "般目的";
|
||||
private static final String DEFAULT_CLAZZ_PURPOSE = "Undefined";
|
||||
|
||||
@Override
|
||||
public void init(BãßBȍőnClazzʸᴰ<?> boon) {
|
||||
BãßBȍőnClazz注 anno = boon.getClass().getAnnotation(BãßBȍőnClazz注.class);
|
||||
String beanPurpose = DEFAULT_CLAZZ_PURPOSE;
|
||||
if (anno != null && !anno.purpose().isBlank()) {
|
||||
beanPurpose = anno.purpose();
|
||||
}
|
||||
boon.toBBC().UNHOLY_SPELL(Ꝑŕḯṿª₮ḕ.class).PUT_GHOST(GHOST_CLAZZ_PURPOSE, beanPurpose);
|
||||
}
|
||||
}
|
||||
|
||||
default String BãßClazzDoel() {
|
||||
return toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).GHOST_STR(Ꝑŕḯṿª₮ḕ.GHOST_CLAZZ_PURPOSE);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package love.distributedrebirth.bassboon.clazz;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.TYPE})
|
||||
public @interface BãßBȍőnClazz注 {
|
||||
|
||||
String purpose();
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package love.distributedrebirth.bassboon.clazz;
|
||||
|
||||
import love.distributedrebirth.bassboon.BãßBȍőnʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPiratePhase注;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPirateʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnꝐŕḯṿª₮ḕ;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
@BãßBȍőnAnnotation注(optional = {BãßBȍőnExport注.class})
|
||||
public interface BãßBȍőnExportʸᴰ<T extends BãßBȍőnʸᴰ<T>> extends BãßBȍőnʸᴰ<T> {
|
||||
|
||||
@BãßBȍőnPiratePhase注(dependencies = {BãßBȍőnPirateʸᴰ.βrahmanBoonLaw.class})
|
||||
public static final class Ꝑŕḯṿª₮ḕ implements BãßBȍőnꝐŕḯṿª₮ḕ<BãßBȍőnExportʸᴰ<?>> {
|
||||
private static final String GHOST_EXPORT_ARTIFACT = "出口人工製品";
|
||||
private static final String GHOST_EXPORT_GROUP = "出口團體";
|
||||
|
||||
@Override
|
||||
public void init(BãßBȍőnExportʸᴰ<?> boon) {
|
||||
BãßBȍőnExport注 anno = boon.getClass().getAnnotation(BãßBȍőnExport注.class);
|
||||
String exportArtifact = boon.getClass().getSimpleName();
|
||||
String exportGroup = boon.getClass().getPackage().getName();
|
||||
if (anno != null && !anno.artifact().isBlank()) {
|
||||
exportArtifact = anno.artifact();
|
||||
}
|
||||
if (anno != null && !anno.group().isBlank()) {
|
||||
exportGroup = anno.group();
|
||||
}
|
||||
boon.toBBC().UNHOLY_SPELL(Ꝑŕḯṿª₮ḕ.class).PUT_GHOST(GHOST_EXPORT_ARTIFACT, exportArtifact);
|
||||
boon.toBBC().UNHOLY_SPELL(Ꝑŕḯṿª₮ḕ.class).PUT_GHOST(GHOST_EXPORT_GROUP, exportGroup);
|
||||
}
|
||||
}
|
||||
|
||||
default String BãßExportNaam() {
|
||||
return toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).GHOST_STR(Ꝑŕḯṿª₮ḕ.GHOST_EXPORT_ARTIFACT);
|
||||
}
|
||||
|
||||
default String BãßExportGroep() {
|
||||
return toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).GHOST_STR(Ꝑŕḯṿª₮ḕ.GHOST_EXPORT_GROUP);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package love.distributedrebirth.bassboon.clazz;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.TYPE})
|
||||
public @interface BãßBȍőnExport注 {
|
||||
|
||||
String artifact() default "";
|
||||
|
||||
String group();
|
||||
}
|
||||
|
|
@ -0,0 +1,184 @@
|
|||
package love.distributedrebirth.bassboon.clazz.pirate;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
import love.distributedrebirth.bassboon.BãßBȍőnʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
import love.distributedrebirth.bassboon.death.spider.BãßBȍőnSpider;
|
||||
import love.distributedrebirth.bassboon.death.spider.BãßBȍőnSpiderEgg注;
|
||||
import love.distributedrebirth.bassboon.death.spider.BãßBȍőnSpiderSilk;
|
||||
import love.distributedrebirth.bassboon.death.spider.BãßBȍőnSpiderWire注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public final class BãßBȍőnPirateLoader {
|
||||
|
||||
private BãßBȍőnPirateLoader() {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T extends BãßBȍőnʸᴰ<T>> void LOCK_BONE_MAGIC(BãßBȍőnʸᴰ<T> boon, BãßBȍőnSpider spider) {
|
||||
try {
|
||||
List<PiratePhaseBoat<T>> filoBoats = loadPirateBoats(boon);
|
||||
Collections.reverse(filoBoats);
|
||||
for (PiratePhaseBoat<T> boat : filoBoats) {
|
||||
boat.pirate.lock((T)boon);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T extends BãßBȍőnʸᴰ<T>> void INIT_BONE_MAGIC(BãßBȍőnʸᴰ<T> boon, BãßBȍőnSpider spider) {
|
||||
try {
|
||||
//System.out.println("INIT "+boon.getClass().getName());
|
||||
for (PiratePhaseBoat<T> boat : loadPirateBoats(boon)) {
|
||||
//System.out.println("INIT.RUN "+v.privateClass.getName()+"."+m.getName());
|
||||
registrateSpiderEggs(boat.pirateClazz, spider, boat.pirate);
|
||||
initSpiderWires(boat.pirate, boon, spider);
|
||||
boat.pirate.init((T)boon);
|
||||
}
|
||||
initSpiderWires(boon, boon, spider);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static void initSpiderWires(Object target, BãßBȍőnʸᴰ<?> boon, BãßBȍőnSpider spider) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
|
||||
//System.out.println("SCAN-BOON-FIELD: "+boon.getClass().getSimpleName());
|
||||
for (Field m:target.getClass().getDeclaredFields()) {
|
||||
if (!m.isAnnotationPresent(BãßBȍőnSpiderWire注.class)) {
|
||||
continue;
|
||||
}
|
||||
BãßBȍőnSpiderWire注 anno = m.getAnnotation(BãßBȍőnSpiderWire注.class);
|
||||
BãßBȍőnSpiderSilk silkRoad = spider.silkRoad(m.getType());
|
||||
Object bean = silkRoad.senseWire(boon, anno.name(), anno.description());
|
||||
//System.out.println("type: "+ m.getType() +" wth name: "+anno.name()+" of boon: "+boon+" result: "+bean.getClass().getName());
|
||||
|
||||
m.setAccessible(true);
|
||||
m.set(target, bean);
|
||||
}
|
||||
}
|
||||
|
||||
private static <T extends BãßBȍőnʸᴰ<T>> void registrateSpiderEggs(Class<?> scanClass, BãßBȍőnSpider spider, BãßBȍőnꝐŕḯṿª₮ḕ<T> pirate) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
|
||||
for (Method m:scanClass.getDeclaredMethods()) {
|
||||
if (!m.isAnnotationPresent(BãßBȍőnSpiderEgg注.class)) {
|
||||
continue;
|
||||
}
|
||||
//System.out.println("annoEgg: "+boon.getClass().getSimpleName()+"."+boon+" from: "+declaredClass.getName()+" m="+m.toGenericString());
|
||||
spider.registrateEgg(m.getReturnType(), pirate, m);
|
||||
}
|
||||
}
|
||||
|
||||
private static class PiratePhaseBoat<T extends BãßBȍőnʸᴰ<T>> {
|
||||
private Class<BãßBȍőnꝐŕḯṿª₮ḕ<T>> pirateClazz;
|
||||
private BãßBȍőnꝐŕḯṿª₮ḕ<T> pirate;
|
||||
|
||||
private PiratePhaseBoat(Class<BãßBȍőnꝐŕḯṿª₮ḕ<T>> pirateClazz) {
|
||||
this.pirateClazz = pirateClazz;
|
||||
try {
|
||||
this.pirate = (BãßBȍőnꝐŕḯṿª₮ḕ<T>) pirateClazz.getConstructor().newInstance();
|
||||
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException
|
||||
| NoSuchMethodException | SecurityException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static <T extends BãßBȍőnʸᴰ<T>> List<PiratePhaseBoat<T>> loadPirateBoats(BãßBȍőnʸᴰ<T> boon) {
|
||||
List<PiratePhaseBoat<T>> boonInits = new ArrayList<>();
|
||||
List<PiratePhaseBoat<T>> serviceInits = new ArrayList<>();
|
||||
walkPrivate(boon, v -> {
|
||||
//System.out.println("INIT.SCAN "+v.getName());
|
||||
BãßBȍőnPiratePhaseBarrier注 anno = v.getAnnotation(BãßBȍőnPiratePhaseBarrier注.class);
|
||||
if (anno != null) {
|
||||
boonInits.add(new PiratePhaseBoat<>(v));
|
||||
} else {
|
||||
serviceInits.add(new PiratePhaseBoat<>(v));
|
||||
}
|
||||
});
|
||||
|
||||
boonInits.sort(new Comparator<PiratePhaseBoat<T>>() {
|
||||
@Override
|
||||
public int compare(PiratePhaseBoat<T> p0, PiratePhaseBoat<T> p1) {
|
||||
BãßBȍőnPiratePhaseBarrier注 anno0 = p0.pirateClazz.getAnnotation(BãßBȍőnPiratePhaseBarrier注.class);
|
||||
BãßBȍőnPiratePhaseBarrier注 anno1 = p1.pirateClazz.getAnnotation(BãßBȍőnPiratePhaseBarrier注.class);
|
||||
return Integer.compare(anno0.order(), anno1.order());
|
||||
}
|
||||
});
|
||||
|
||||
List<PiratePhaseBoat<T>> result = new ArrayList<>();
|
||||
for (PiratePhaseBoat<T> startupPhase:boonInits) {
|
||||
result.add(startupPhase);
|
||||
for (PiratePhaseBoat<T> v:new ArrayList<>(serviceInits)) {
|
||||
int depCount = 0;
|
||||
List<Class<? extends BãßBȍőnꝐŕḯṿª₮ḕ<?>>> deps = new ArrayList<>();
|
||||
BãßBȍőnPiratePhase注 anno = v.pirateClazz.getAnnotation(BãßBȍőnPiratePhase注.class);
|
||||
if (anno != null) {
|
||||
deps.addAll(Arrays.asList(anno.dependencies()));
|
||||
} else {
|
||||
deps.add(BãßBȍőnPirateʸᴰ.שְׁלֹמֹה.DEFAULT_PHASE);
|
||||
}
|
||||
for (Class<?> clazz:deps) {
|
||||
for (PiratePhaseBoat<T> doneInit:result) {
|
||||
if (clazz.equals(doneInit.pirateClazz)) {
|
||||
depCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (depCount == deps.size()) {
|
||||
result.add(v);
|
||||
serviceInits.remove(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
result.addAll(serviceInits);
|
||||
return result;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private static <T extends BãßBȍőnʸᴰ<T>> void walkPrivate(BãßBȍőnʸᴰ<T> boon, Consumer<Class<BãßBȍőnꝐŕḯṿª₮ḕ<T>>> runPrivate) {
|
||||
for (Class<?> interfaceClass:walkInterfaces(boon.getClass(), new LinkedHashSet<>())) {
|
||||
for (Class<?> declaredClass:interfaceClass.getDeclaredClasses()) {
|
||||
if (!BãßBȍőnꝐŕḯṿª₮ḕ.class.isAssignableFrom(declaredClass)) {
|
||||
continue;
|
||||
}
|
||||
runPrivate.accept((Class<BãßBȍőnꝐŕḯṿª₮ḕ<T>>)declaredClass);
|
||||
}
|
||||
}
|
||||
for (Class<?> declaredClass:boon.getClass().getDeclaredClasses()) {
|
||||
if (!BãßBȍőnꝐŕḯṿª₮ḕ.class.isAssignableFrom(declaredClass)) {
|
||||
continue;
|
||||
}
|
||||
runPrivate.accept((Class<BãßBȍőnꝐŕḯṿª₮ḕ<T>>)declaredClass);
|
||||
}
|
||||
}
|
||||
|
||||
public static Set<Class<?>> walkInterfaces(Class<?> clazz, Set<Class<?>> result) {
|
||||
return walkTree(clazz, result, v -> Arrays.asList(v.getInterfaces()), v -> v.getSuperclass());
|
||||
}
|
||||
|
||||
public static <N> Set<N> walkTree(N node, Set<N> result, Function<N, Collection<N>> childs, Function<N,N> resolve) {
|
||||
while (node != null) {
|
||||
for (N next : childs.apply(node)) {
|
||||
if (result.add(next)) {
|
||||
walkTree(next, result, childs, resolve);
|
||||
}
|
||||
}
|
||||
node = resolve.apply(node);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package love.distributedrebirth.bassboon.clazz.pirate;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.TYPE})
|
||||
public @interface BãßBȍőnPiratePhaseBarrier注 {
|
||||
|
||||
int order();
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package love.distributedrebirth.bassboon.clazz.pirate;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.TYPE})
|
||||
public @interface BãßBȍőnPiratePhase注 {
|
||||
|
||||
Class<? extends BãßBȍőnꝐŕḯṿª₮ḕ<?>>[] dependencies();
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package love.distributedrebirth.bassboon.clazz.pirate;
|
||||
|
||||
import love.distributedrebirth.bassboon.Bãß;
|
||||
import love.distributedrebirth.bassboon.BãßBȍőnʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnClazz注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
@BãßBȍőnClazz注(purpose = "Adds extensible phase barriers for pirates")
|
||||
public interface BãßBȍőnPirateʸᴰ<T extends BãßBȍőnʸᴰ<T>> extends BãßBȍőnʸᴰ<T> {
|
||||
|
||||
public static final class שְׁלֹמֹה {
|
||||
// default internal framework boon phases
|
||||
protected static final int BOON_VOID = Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO;
|
||||
protected static final int BOON_BERESHIT = BOON_VOID + Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ONE;
|
||||
protected static final int BOON_LAW = BOON_BERESHIT * Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_TEN;
|
||||
protected static final int BOON_MARRIAGE = BOON_LAW + Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ONE;
|
||||
// default external implementation boon phases
|
||||
protected static final int LIFE_QUADRANT_仙 = 00+00+00+1+2+3+4+5+6+7+8+9;
|
||||
protected static final int LIFE_QUADRANT_上 = 10+11+12+13+14+15+16+17+18;
|
||||
protected static final int LIFE_QUADRANT_主 = 19+20+21+22+23+24+25+26+27;
|
||||
protected static final int LIFE_QUADRANT_天 = 28+29+30+31+32+33+34+35+36;
|
||||
protected static final int LIFE_יהוה = LIFE_QUADRANT_仙 + LIFE_QUADRANT_上 + LIFE_QUADRANT_主 + LIFE_QUADRANT_天;
|
||||
|
||||
protected static final Class<? extends BãßBȍőnꝐŕḯṿª₮ḕ<?>> DEFAULT_PHASE = βrahmanLifeInit.class;
|
||||
|
||||
private שְׁלֹמֹה() {
|
||||
}
|
||||
}
|
||||
|
||||
@BãßBȍőnPiratePhaseBarrier注(order = שְׁלֹמֹה.BOON_VOID)
|
||||
public static final class βrahmanBoonVoid implements BãßBȍőnꝐŕḯṿª₮ḕ<BãßBȍőnPirateʸᴰ<?>> {
|
||||
}
|
||||
|
||||
@BãßBȍőnPiratePhaseBarrier注(order = שְׁלֹמֹה.BOON_BERESHIT)
|
||||
public static final class βrahmanBoonBereshit implements BãßBȍőnꝐŕḯṿª₮ḕ<BãßBȍőnPirateʸᴰ<?>> {
|
||||
}
|
||||
|
||||
@BãßBȍőnPiratePhaseBarrier注(order = שְׁלֹמֹה.BOON_LAW)
|
||||
public static final class βrahmanBoonLaw implements BãßBȍőnꝐŕḯṿª₮ḕ<BãßBȍőnPirateʸᴰ<?>> {
|
||||
}
|
||||
|
||||
@BãßBȍőnPiratePhaseBarrier注(order = שְׁלֹמֹה.BOON_MARRIAGE)
|
||||
public static final class βrahmanBoonMarriage implements BãßBȍőnꝐŕḯṿª₮ḕ<BãßBȍőnPirateʸᴰ<?>> {
|
||||
}
|
||||
|
||||
@BãßBȍőnPiratePhaseBarrier注(order = שְׁלֹמֹה.LIFE_QUADRANT_仙)
|
||||
public static final class βrahmanLifeQuadrant仙 implements BãßBȍőnꝐŕḯṿª₮ḕ<BãßBȍőnPirateʸᴰ<?>> {
|
||||
}
|
||||
|
||||
@BãßBȍőnPiratePhaseBarrier注(order = שְׁלֹמֹה.LIFE_QUADRANT_上)
|
||||
public static final class βrahmanLifeQuadrant上 implements BãßBȍőnꝐŕḯṿª₮ḕ<BãßBȍőnPirateʸᴰ<?>> {
|
||||
}
|
||||
|
||||
@BãßBȍőnPiratePhaseBarrier注(order = שְׁלֹמֹה.LIFE_QUADRANT_主)
|
||||
public static final class βrahmanLifeQuadrant主 implements BãßBȍőnꝐŕḯṿª₮ḕ<BãßBȍőnPirateʸᴰ<?>> {
|
||||
}
|
||||
|
||||
@BãßBȍőnPiratePhaseBarrier注(order = שְׁלֹמֹה.LIFE_QUADRANT_天)
|
||||
public static final class βrahmanLifeQuadrant天 implements BãßBȍőnꝐŕḯṿª₮ḕ<BãßBȍőnPirateʸᴰ<?>> {
|
||||
}
|
||||
|
||||
@BãßBȍőnPiratePhaseBarrier注(order = שְׁלֹמֹה.LIFE_יהוה)
|
||||
public static final class βrahmanLifeInit implements BãßBȍőnꝐŕḯṿª₮ḕ<BãßBȍőnPirateʸᴰ<?>> {
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package love.distributedrebirth.bassboon.clazz.pirate;
|
||||
|
||||
import love.distributedrebirth.bassboon.BãßBȍőnʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface BãßBȍőnꝐŕḯṿª₮ḕ<T extends BãßBȍőnʸᴰ<?>> {
|
||||
// note: eclipse ide does not want to refactor items with the name "Ꝑŕḯṿª₮ḕ" in it.
|
||||
|
||||
default void init(T boon) {
|
||||
}
|
||||
|
||||
default void lock(T boon) {
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package love.distributedrebirth.bassboon.death;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnꝐŕḯṿª₮ḕ;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface BãßBȍőnCoffin {
|
||||
|
||||
BãßBȍőnCoffinGhost UNHOLY(Class<? extends BãßBȍőnꝐŕḯṿª₮ḕ<?>> familyName);
|
||||
|
||||
BãßBȍőnCoffinGhostSpell UNHOLY_SPELL(Class<? extends BãßBȍőnꝐŕḯṿª₮ḕ<?>> familyName);
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
package love.distributedrebirth.bassboon.death;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface BãßBȍőnCoffinGhost {
|
||||
|
||||
Object GHOST_OBJ(String key);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default <Y> Y GHOST_OBJ(String key, Class<Y> type) {
|
||||
return (Y) GHOST_OBJ(key);
|
||||
}
|
||||
|
||||
default String GHOST_STR(String key) {
|
||||
return String.class.cast(GHOST_OBJ(key));
|
||||
}
|
||||
|
||||
default Short GHOST_SHORT(String key) {
|
||||
return Short.class.cast(GHOST_OBJ(key));
|
||||
}
|
||||
|
||||
default Character GHOST_CHAR(String key) {
|
||||
return Character.class.cast(GHOST_OBJ(key));
|
||||
}
|
||||
|
||||
default Integer GHOST_INT(String key) {
|
||||
return Integer.class.cast(GHOST_OBJ(key));
|
||||
}
|
||||
|
||||
default Long GHOST_LONG(String key) {
|
||||
return Long.class.cast(GHOST_OBJ(key));
|
||||
}
|
||||
|
||||
default Boolean GHOST_BOOL(String key) {
|
||||
return Boolean.class.cast(GHOST_OBJ(key));
|
||||
}
|
||||
|
||||
default Float GHOST_FLOAT(String key) {
|
||||
return Float.class.cast(GHOST_OBJ(key));
|
||||
}
|
||||
|
||||
default Double GHOST_DOUBLE(String key) {
|
||||
return Double.class.cast(GHOST_OBJ(key));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default Map<String,Object> GHOST_MAP_OBJ(String key) {
|
||||
return Map.class.cast(GHOST_OBJ(key));
|
||||
}
|
||||
|
||||
default Object GHOST_MAP_OBJ_VALUE(String key, String valueKey) {
|
||||
return GHOST_MAP_OBJ(key).get(valueKey);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default Map<String,String> GHOST_MAP_STR(String key) {
|
||||
return Map.class.cast(GHOST_OBJ(key));
|
||||
}
|
||||
|
||||
default String GHOST_MAP_STR_VALUE(String key, String valueKey) {
|
||||
return GHOST_MAP_STR(key).get(valueKey);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default Map<String,Integer> GHOST_MAP_INT(String key) {
|
||||
return Map.class.cast(GHOST_OBJ(key));
|
||||
}
|
||||
|
||||
default Integer GHOST_MAP_INT_VALUE(String key, String valueKey) {
|
||||
return GHOST_MAP_INT(key).get(valueKey);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default List<Object> GHOST_LIST_OBJ(String key) {
|
||||
return List.class.cast(GHOST_OBJ(key));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default List<String> GHOST_LIST_STR(String key) {
|
||||
return List.class.cast(GHOST_OBJ(key));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default List<Integer> GHOST_LIST_INT(String key) {
|
||||
return List.class.cast(GHOST_OBJ(key));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package love.distributedrebirth.bassboon.death;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface BãßBȍőnCoffinGhostSpell extends BãßBȍőnCoffinGhost {
|
||||
|
||||
Object PUT_GHOST(String key, Object value);
|
||||
|
||||
default void PUT_GHOST_MAP(String key) {
|
||||
PUT_GHOST(key, new HashMap<>());
|
||||
}
|
||||
|
||||
default void PUT_GHOST_LIST(String key) {
|
||||
PUT_GHOST(key, new ArrayList<>());
|
||||
}
|
||||
|
||||
static BãßBȍőnCoffinGhostSpell castᴼᶠ(BãßBȍőnCoffinGhost death) {
|
||||
return (BãßBȍőnCoffinGhostSpell) death;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package love.distributedrebirth.bassboon.death;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface BãßBȍőnCoffinGhostSpellLock extends BãßBȍőnCoffinGhostSpell {
|
||||
|
||||
BãßBȍőnCoffinGhost LOCK();
|
||||
|
||||
static BãßBȍőnCoffinGhostSpellLock castᴼᶠ(BãßBȍőnCoffinGhost death) {
|
||||
return (BãßBȍőnCoffinGhostSpellLock) death;
|
||||
}
|
||||
|
||||
static BãßBȍőnCoffinGhostSpellLock instanceᴺᵉʷ() {
|
||||
Function<Map<String,Object>,BãßBȍőnCoffinGhost> keyMaker = v -> {
|
||||
Map<String,Object> summonedGhosts = new HashMap<>(v);
|
||||
for (String entity:v.keySet()) {
|
||||
Object spirit = summonedGhosts.get(entity);
|
||||
if (spirit instanceof List) {
|
||||
summonedGhosts.put(entity, Collections.unmodifiableList((List<?>) spirit));
|
||||
}
|
||||
if (spirit instanceof Map) {
|
||||
summonedGhosts.put(entity, Collections.unmodifiableMap((Map<?,?>) spirit));
|
||||
}
|
||||
}
|
||||
return new BãßBȍőnCoffinGhost() {
|
||||
@Override
|
||||
public Object GHOST_OBJ(String key) {
|
||||
return summonedGhosts.get(key);
|
||||
}
|
||||
};
|
||||
};
|
||||
return new BãßBȍőnCoffinGhostSpellLock() {
|
||||
private final Map<String,Object> ouijaBoard = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public BãßBȍőnCoffinGhost LOCK() {
|
||||
return keyMaker.apply(ouijaBoard);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object GHOST_OBJ(String key) {
|
||||
return ouijaBoard.get(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object PUT_GHOST(String key, Object value) {
|
||||
return ouijaBoard.put(key, value);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
package love.distributedrebirth.bassboon.death.spider;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import love.distributedrebirth.bassboon.BãßBȍőnʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnꝐŕḯṿª₮ḕ;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public class BãßBȍőnSpider {
|
||||
|
||||
private final Map<Class<?>, BãßBȍőnSpiderSilk> spiderWeb = new HashMap<>();
|
||||
|
||||
public BãßBȍőnSpider() {
|
||||
}
|
||||
|
||||
public boolean hasEggType(Class<?> eggType) {
|
||||
return spiderWeb.containsKey(eggType);
|
||||
}
|
||||
|
||||
public BãßBȍőnSpiderSilk silkRoad(Class<?> eggType) {
|
||||
BãßBȍőnSpiderSilk silkRoad = spiderWeb.get(eggType);
|
||||
if (silkRoad == null) {
|
||||
throw new IllegalStateException("No silk road found for type: "+eggType);
|
||||
}
|
||||
return silkRoad;
|
||||
}
|
||||
|
||||
public void registrateEgg(Class<?> eggType, BãßBȍőnSpiderSilk spiderSilk) {
|
||||
if (spiderWeb.containsKey(eggType)) {
|
||||
throw new IllegalStateException("Can't registate class twice: "+eggType);
|
||||
}
|
||||
spiderWeb.put(eggType, spiderSilk);
|
||||
}
|
||||
|
||||
public void registrateEgg(Class<?> eggType, BãßBȍőnꝐŕḯṿª₮ḕ<?> pirate, Method m) {
|
||||
registrateEgg(eggType, createSenseWire(pirate, m));
|
||||
}
|
||||
|
||||
public BãßBȍőnSpiderSilk createSenseWire(BãßBȍőnꝐŕḯṿª₮ḕ<?> pirate, Method m) {
|
||||
boolean valid = false;
|
||||
Class<?>[] para = m.getParameterTypes();
|
||||
if (para.length == 0) {
|
||||
valid = true;
|
||||
}
|
||||
if (para.length == 1 && BãßBȍőnʸᴰ.class.isAssignableFrom(para[0])) {
|
||||
valid = true;
|
||||
}
|
||||
if (para.length == 2 && BãßBȍőnʸᴰ.class.isAssignableFrom(para[0]) && String.class.isAssignableFrom(para[1])) {
|
||||
valid = true;
|
||||
}
|
||||
if (para.length == 3 && BãßBȍőnʸᴰ.class.isAssignableFrom(para[0]) && String.class.isAssignableFrom(para[1]) && String.class.isAssignableFrom(para[2])) {
|
||||
valid = true;
|
||||
}
|
||||
if (!valid) {
|
||||
throw new IllegalStateException("Unknown method parameters on: "+m.getDeclaringClass().getSimpleName()+"."+m.toGenericString());
|
||||
}
|
||||
return new BãßBȍőnSpiderSilk() {
|
||||
|
||||
@Override
|
||||
public Object senseWire(BãßBȍőnʸᴰ<?> boon, String name, String description) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
|
||||
Class<?>[] para = m.getParameterTypes();
|
||||
if (para.length == 0) {
|
||||
return m.invoke(pirate);
|
||||
}
|
||||
if (para.length == 1 && BãßBȍőnʸᴰ.class.isAssignableFrom(para[0])) {
|
||||
return m.invoke(pirate, boon);
|
||||
}
|
||||
if (para.length == 2 && BãßBȍőnʸᴰ.class.isAssignableFrom(para[0]) && String.class.isAssignableFrom(para[1])) {
|
||||
return m.invoke(pirate, boon, name);
|
||||
}
|
||||
if (para.length == 3 && BãßBȍőnʸᴰ.class.isAssignableFrom(para[0]) && String.class.isAssignableFrom(para[1]) && String.class.isAssignableFrom(para[2])) {
|
||||
return m.invoke(pirate, boon, name, description);
|
||||
}
|
||||
throw new IllegalStateException("Unknown method parameters on: "+m.getDeclaringClass().getSimpleName()+"."+m.toGenericString());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package love.distributedrebirth.bassboon.death.spider;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.METHOD})
|
||||
public @interface BãßBȍőnSpiderEgg注 {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package love.distributedrebirth.bassboon.death.spider;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import love.distributedrebirth.bassboon.BãßBȍőnʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface BãßBȍőnSpiderSilk {
|
||||
|
||||
Object senseWire(BãßBȍőnʸᴰ<?> boon, String name, String description) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException;
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package love.distributedrebirth.bassboon.death.spider;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.FIELD})
|
||||
public @interface BãßBȍőnSpiderWire注 {
|
||||
|
||||
String name() default "";
|
||||
|
||||
String description() default "";
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package love.distributedrebirth.bassboon.ydmod;
|
||||
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface BãßBȍőnModuleFactory {
|
||||
// unused
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package love.distributedrebirth.bassboon.ydmod.jmx;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
abstract public class AbstractMBeanAttributeᴶᴹˣ implements MBeanAttributeᴶᴹˣ {
|
||||
private final String name;
|
||||
private final String description;
|
||||
|
||||
public AbstractMBeanAttributeᴶᴹˣ(String name, String description) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package love.distributedrebirth.bassboon.ydmod.jmx;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
@MBeanAttributeType注(Boolean.class)
|
||||
public class AttributeBooleanᴶᴹˣ extends AbstractMBeanAttributeᴶᴹˣ {
|
||||
private Boolean value;
|
||||
|
||||
public AttributeBooleanᴶᴹˣ(String name, String description) {
|
||||
super(name, description);
|
||||
}
|
||||
|
||||
public void setValueBoolean(Boolean value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Boolean getValueBoolean() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package love.distributedrebirth.bassboon.ydmod.jmx;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
@MBeanAttributeType注(Integer.class)
|
||||
public class AttributeIntegerᴶᴹˣ extends AbstractMBeanAttributeᴶᴹˣ {
|
||||
private Integer value;
|
||||
|
||||
public AttributeIntegerᴶᴹˣ(String name, String description) {
|
||||
super(name, description);
|
||||
}
|
||||
|
||||
public void setValueInteger(Integer value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Integer getValueInteger() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package love.distributedrebirth.bassboon.ydmod.jmx;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
@MBeanAttributeType注(Long.class)
|
||||
public class AttributeLongᴶᴹˣ extends AbstractMBeanAttributeᴶᴹˣ {
|
||||
private Long value;
|
||||
|
||||
public AttributeLongᴶᴹˣ(String name, String description) {
|
||||
super(name, description);
|
||||
}
|
||||
|
||||
public void setValueLong(Long value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Long getValueLong() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package love.distributedrebirth.bassboon.ydmod.jmx;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
@MBeanAttributeType注(String.class)
|
||||
public class AttributeStringᴶᴹˣ extends AbstractMBeanAttributeᴶᴹˣ {
|
||||
private String value;
|
||||
|
||||
public AttributeStringᴶᴹˣ(String name, String description) {
|
||||
super(name, description);
|
||||
}
|
||||
|
||||
public void setValueString(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValueString() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package love.distributedrebirth.bassboon.ydmod.jmx;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
@MBeanAttributeType注(Long.class)
|
||||
public class CounterGuageᴶᴹˣ extends AbstractMBeanAttributeᴶᴹˣ {
|
||||
private volatile long counter;
|
||||
|
||||
public CounterGuageᴶᴹˣ(String name, String description) {
|
||||
super(name, description);
|
||||
}
|
||||
|
||||
public void increment() {
|
||||
counter++;
|
||||
}
|
||||
|
||||
public void increment(long value) {
|
||||
counter = counter + value;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return Long.valueOf(counter);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
package love.distributedrebirth.bassboon.ydmod.jmx;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.management.InstanceAlreadyExistsException;
|
||||
import javax.management.MBeanRegistrationException;
|
||||
import javax.management.MBeanServer;
|
||||
import javax.management.NotCompliantMBeanException;
|
||||
import javax.management.ObjectName;
|
||||
|
||||
import love.distributedrebirth.bassboon.BãßBȍőnʸᴰ;
|
||||
import love.distributedrebirth.bassboon.DefaultEnumBaseʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAnnotation注;
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnClazz注;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPiratePhase注;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPirateʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnꝐŕḯṿª₮ḕ;
|
||||
import love.distributedrebirth.bassboon.death.spider.BãßBȍőnSpiderEgg注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
@BãßBȍőnAnnotation注(required = {BãßBȍőnClazz注.class})
|
||||
public interface DefaultEnumBaseᴶᴹˣ<T extends BãßBȍőnʸᴰ<T>> extends DefaultEnumBaseʸᴰ<T> {
|
||||
|
||||
@BãßBȍőnPiratePhase注(dependencies = {BãßBȍőnPirateʸᴰ.βrahmanBoonBereshit.class})
|
||||
public static final class Ꝑŕḯṿª₮ḕ implements BãßBȍőnꝐŕḯṿª₮ḕ<DefaultEnumBaseᴶᴹˣ<?>> {
|
||||
protected static final String STR_NAME = "name";
|
||||
protected static final String STR_TYPE = "type";
|
||||
protected static final String STR_DOT = ".";
|
||||
protected static final String STR_COLON = ":";
|
||||
protected static final String STR_IS = "=";
|
||||
protected static final String STR_COMMA = ",";
|
||||
private static final String GHOST_JMX = "爪哇管理擴展";
|
||||
|
||||
@Override
|
||||
public void init(DefaultEnumBaseᴶᴹˣ<?> boon) {
|
||||
boon.toBBC().UNHOLY_SPELL(Ꝑŕḯṿª₮ḕ.class).PUT_GHOST(Ꝑŕḯṿª₮ḕ.GHOST_JMX, new HashMap<>());
|
||||
}
|
||||
|
||||
public <X> X buildJmxGhost(DefaultEnumBaseᴶᴹˣ<?> boon, String name, X result) {
|
||||
boon.toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).GHOST_MAP_OBJ(Ꝑŕḯṿª₮ḕ.GHOST_JMX).put(name, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@BãßBȍőnSpiderEgg注()
|
||||
public CounterGuageᴶᴹˣ buildGuageCounter(DefaultEnumBaseᴶᴹˣ<?> boon, String name, String description) {
|
||||
return buildJmxGhost(boon, name, new CounterGuageᴶᴹˣ(name, description));
|
||||
}
|
||||
|
||||
@BãßBȍőnSpiderEgg注()
|
||||
public AttributeStringᴶᴹˣ buildStringAttribute(DefaultEnumBaseᴶᴹˣ<?> boon, String name, String description) {
|
||||
return buildJmxGhost(boon, name, new AttributeStringᴶᴹˣ(name, description));
|
||||
}
|
||||
|
||||
@BãßBȍőnSpiderEgg注()
|
||||
public AttributeBooleanᴶᴹˣ buildBooleanAttribute(DefaultEnumBaseᴶᴹˣ<?> boon, String name, String description) {
|
||||
return buildJmxGhost(boon, name, new AttributeBooleanᴶᴹˣ(name, description));
|
||||
}
|
||||
|
||||
@BãßBȍőnSpiderEgg注()
|
||||
public AttributeIntegerᴶᴹˣ buildIntegerAttribute(DefaultEnumBaseᴶᴹˣ<?> boon, String name, String description) {
|
||||
return buildJmxGhost(boon, name, new AttributeIntegerᴶᴹˣ(name, description));
|
||||
}
|
||||
|
||||
@BãßBȍőnSpiderEgg注()
|
||||
public AttributeLongᴶᴹˣ buildLongAttribute(DefaultEnumBaseᴶᴹˣ<?> boon, String name, String description) {
|
||||
return buildJmxGhost(boon, name, new AttributeLongᴶᴹˣ(name, description));
|
||||
}
|
||||
|
||||
@BãßBȍőnSpiderEgg注()
|
||||
public MBeanServerᴶᴹˣ buildMBeanServer(DefaultEnumBaseᴶᴹˣ<?> boon) {
|
||||
return new MBeanServerᴶᴹˣ() {
|
||||
private final MBeanServer server = ManagementFactory.getPlatformMBeanServer();
|
||||
|
||||
@Override
|
||||
public MBeanServer getServerᴶᴹˣ() {
|
||||
return server;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ObjectName toNameᴶᴹˣ(String name) {
|
||||
try {
|
||||
return new ObjectName(name);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerᴶᴹˣ(Object mbean, ObjectName objectName) {
|
||||
try {
|
||||
server.registerMBean(mbean, objectName);
|
||||
} catch (InstanceAlreadyExistsException | MBeanRegistrationException
|
||||
| NotCompliantMBeanException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static MBeanDynamicᴶᴹˣ BeanCreateᴶᴹˣ(DefaultEnumBaseᴶᴹˣ<?> boon) {
|
||||
return new MBeanDynamicᴶᴹˣ(boon.BãßClazzDoel(), BeanGhostsᴶᴹˣ(boon));
|
||||
}
|
||||
|
||||
protected static Map<String, Object> BeanGhostsᴶᴹˣ(DefaultEnumBaseᴶᴹˣ<?> boon) {
|
||||
return boon.toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).GHOST_MAP_OBJ(Ꝑŕḯṿª₮ḕ.GHOST_JMX);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package love.distributedrebirth.bassboon.ydmod.jmx;
|
||||
|
||||
import love.distributedrebirth.bassboon.BãßBȍőnʸᴰ;
|
||||
import love.distributedrebirth.bassboon.DefaultEnumInstanceʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPiratePhase注;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPirateʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnꝐŕḯṿª₮ḕ;
|
||||
import love.distributedrebirth.bassboon.death.spider.BãßBȍőnSpiderWire注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface DefaultEnumInstanceᴶᴹˣ<T extends BãßBȍőnʸᴰ<T>> extends DefaultEnumBaseᴶᴹˣ<T>,DefaultEnumInstanceʸᴰ<T> {
|
||||
|
||||
@BãßBȍőnPiratePhase注(dependencies = {BãßBȍőnPirateʸᴰ.βrahmanBoonMarriage.class})
|
||||
public static final class Ꝑŕḯṿª₮ḕ implements BãßBȍőnꝐŕḯṿª₮ḕ<DefaultEnumInstanceᴶᴹˣ<?>> {
|
||||
|
||||
@BãßBȍőnSpiderWire注
|
||||
private MBeanServerᴶᴹˣ factory;
|
||||
|
||||
@Override
|
||||
public void init(DefaultEnumInstanceᴶᴹˣ<?> boon) {
|
||||
StringBuilder name = new StringBuilder();
|
||||
name.append(boon.BãßExportGroep());
|
||||
name.append(DefaultEnumBaseᴶᴹˣ.Ꝑŕḯṿª₮ḕ.STR_COLON);
|
||||
name.append(DefaultEnumBaseᴶᴹˣ.Ꝑŕḯṿª₮ḕ.STR_TYPE);
|
||||
name.append(DefaultEnumBaseᴶᴹˣ.Ꝑŕḯṿª₮ḕ.STR_IS);
|
||||
name.append(boon.BãßExportNaam());
|
||||
MBeanDynamicᴶᴹˣ mbean = DefaultEnumBaseᴶᴹˣ.Ꝑŕḯṿª₮ḕ.BeanCreateᴶᴹˣ(boon);
|
||||
factory.registerᴶᴹˣ(mbean, factory.toNameᴶᴹˣ(name.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package love.distributedrebirth.bassboon.ydmod.jmx;
|
||||
|
||||
import love.distributedrebirth.bassboon.BãßBȍőnʸᴰ;
|
||||
import love.distributedrebirth.bassboon.DefaultEnumSetʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPiratePhase注;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPirateʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnꝐŕḯṿª₮ḕ;
|
||||
import love.distributedrebirth.bassboon.death.spider.BãßBȍőnSpiderWire注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface DefaultEnumSetᴶᴹˣ<T extends BãßBȍőnʸᴰ<T>> extends DefaultEnumBaseᴶᴹˣ<T>,DefaultEnumSetʸᴰ<T> {
|
||||
|
||||
@BãßBȍőnPiratePhase注(dependencies = {BãßBȍőnPirateʸᴰ.βrahmanBoonMarriage.class})
|
||||
public static final class Ꝑŕḯṿª₮ḕ implements BãßBȍőnꝐŕḯṿª₮ḕ<DefaultEnumSetᴶᴹˣ<?>> {
|
||||
|
||||
@BãßBȍőnSpiderWire注
|
||||
private MBeanServerᴶᴹˣ factory;
|
||||
|
||||
@Override
|
||||
public void init(DefaultEnumSetᴶᴹˣ<?> boon) {
|
||||
StringBuilder name = new StringBuilder();
|
||||
name.append(boon.BãßExportGroep());
|
||||
name.append(DefaultEnumBaseᴶᴹˣ.Ꝑŕḯṿª₮ḕ.STR_COLON);
|
||||
name.append(DefaultEnumBaseᴶᴹˣ.Ꝑŕḯṿª₮ḕ.STR_TYPE);
|
||||
name.append(DefaultEnumBaseᴶᴹˣ.Ꝑŕḯṿª₮ḕ.STR_IS);
|
||||
name.append(boon.BãßExportNaam());
|
||||
name.append(DefaultEnumBaseᴶᴹˣ.Ꝑŕḯṿª₮ḕ.STR_COMMA);
|
||||
name.append(DefaultEnumBaseᴶᴹˣ.Ꝑŕḯṿª₮ḕ.STR_NAME);
|
||||
name.append(DefaultEnumBaseᴶᴹˣ.Ꝑŕḯṿª₮ḕ.STR_IS);
|
||||
name.append(boon.BȍőnNaam());
|
||||
MBeanDynamicᴶᴹˣ mbean = DefaultEnumBaseᴶᴹˣ.Ꝑŕḯṿª₮ḕ.BeanCreateᴶᴹˣ(boon);
|
||||
factory.registerᴶᴹˣ(mbean, factory.toNameᴶᴹˣ(name.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package love.distributedrebirth.bassboon.ydmod.jmx;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.TYPE})
|
||||
public @interface MBeanAttributeType注 {
|
||||
|
||||
Class<?> value();
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package love.distributedrebirth.bassboon.ydmod.jmx;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface MBeanAttributeᴶᴹˣ {
|
||||
|
||||
default Class<?> BãßValueType() {
|
||||
return getClass().getAnnotation(MBeanAttributeType注.class).value();
|
||||
}
|
||||
|
||||
Object getValue();
|
||||
|
||||
String getName();
|
||||
|
||||
String getDescription();
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package love.distributedrebirth.bassboon.ydmod.jmx;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.management.Attribute;
|
||||
import javax.management.AttributeList;
|
||||
import javax.management.AttributeNotFoundException;
|
||||
import javax.management.DynamicMBean;
|
||||
import javax.management.InvalidAttributeValueException;
|
||||
import javax.management.MBeanAttributeInfo;
|
||||
import javax.management.MBeanException;
|
||||
import javax.management.MBeanInfo;
|
||||
import javax.management.MBeanNotificationInfo;
|
||||
import javax.management.ReflectionException;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public class MBeanDynamicᴶᴹˣ implements DynamicMBean {
|
||||
|
||||
private final String description;
|
||||
private final Map<String, Object> attributeMap;
|
||||
|
||||
public MBeanDynamicᴶᴹˣ(String description, Map<String, Object> attributeMap) {
|
||||
this.description = description;
|
||||
this.attributeMap = attributeMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MBeanInfo getMBeanInfo() {
|
||||
MBeanAttributeInfo[] dAttributes = new MBeanAttributeInfo[attributeMap.keySet().size()];
|
||||
List<String> keySet = attributeMap.keySet().stream().collect(Collectors.toList());
|
||||
for (int i = 0; i < dAttributes.length; i++) {
|
||||
String name = keySet.get(i);
|
||||
MBeanAttributeᴶᴹˣ gc = MBeanAttributeᴶᴹˣ.class.cast(attributeMap.get(name));
|
||||
dAttributes[i] = new MBeanAttributeInfo(gc.getName(), gc.BãßValueType().getSimpleName(),
|
||||
gc.getDescription(), true, false, false);
|
||||
}
|
||||
return new MBeanInfo(this.getClass().getName(), description, dAttributes, null, null,
|
||||
new MBeanNotificationInfo[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getAttribute(String name) throws AttributeNotFoundException, MBeanException, ReflectionException {
|
||||
MBeanAttributeᴶᴹˣ gc = MBeanAttributeᴶᴹˣ.class.cast(attributeMap.get(name));
|
||||
return gc.getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttributeList getAttributes(String[] arg0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object invoke(String arg0, Object[] arg1, String[] arg2) throws MBeanException, ReflectionException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttribute(Attribute arg0)
|
||||
throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttributeList setAttributes(AttributeList arg0) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package love.distributedrebirth.bassboon.ydmod.jmx;
|
||||
|
||||
import javax.management.MBeanServer;
|
||||
import javax.management.ObjectName;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface MBeanServerᴶᴹˣ {
|
||||
|
||||
MBeanServer getServerᴶᴹˣ();
|
||||
|
||||
ObjectName toNameᴶᴹˣ(String name);
|
||||
|
||||
void registerᴶᴹˣ(Object mbean, ObjectName objectName);
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
package love.distributedrebirth.bassboon.ydmod.zombie;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface BãßBȍőnEnumZombie<T extends BãßBȍőnEnumZombieBullet> {
|
||||
|
||||
Object GET_OBJ(T key);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default <Y> Y GET_OBJ(T key, Class<Y> type) {
|
||||
return (Y) GET_OBJ(key);
|
||||
}
|
||||
|
||||
default String GET_STR(T key) {
|
||||
return String.class.cast(GET_OBJ(key));
|
||||
}
|
||||
|
||||
default Short GET_SHORT(T key) {
|
||||
return Short.class.cast(GET_OBJ(key));
|
||||
}
|
||||
|
||||
default Character GET_CHAR(T key) {
|
||||
return Character.class.cast(GET_OBJ(key));
|
||||
}
|
||||
|
||||
default Integer GET_INT(T key) {
|
||||
return Integer.class.cast(GET_OBJ(key));
|
||||
}
|
||||
|
||||
default Long GET_LONG(T key) {
|
||||
return Long.class.cast(GET_OBJ(key));
|
||||
}
|
||||
|
||||
default Boolean GET_BOOL(T key) {
|
||||
return Boolean.class.cast(GET_OBJ(key));
|
||||
}
|
||||
|
||||
default Float GET_FLOAT(T key) {
|
||||
return Float.class.cast(GET_OBJ(key));
|
||||
}
|
||||
|
||||
default Double GET_DOUBLE(T key) {
|
||||
return Double.class.cast(GET_OBJ(key));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default Map<String,Object> GET_MAP_OBJ(T key) {
|
||||
return Map.class.cast(GET_OBJ(key));
|
||||
}
|
||||
|
||||
default Object GET_MAP_OBJ_VALUE(T key, String valueKey) {
|
||||
return GET_MAP_OBJ(key).get(valueKey);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default Map<String,String> GET_MAP_STR(T key) {
|
||||
return Map.class.cast(GET_OBJ(key));
|
||||
}
|
||||
|
||||
default String GET_MAP_STR_VALUE(T key, String valueKey) {
|
||||
return GET_MAP_STR(key).get(valueKey);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default Map<String,Integer> GET_MAP_INT(T key) {
|
||||
return Map.class.cast(GET_OBJ(key));
|
||||
}
|
||||
|
||||
default Integer GET_MAP_INT_VALUE(T key, String valueKey) {
|
||||
return GET_MAP_INT(key).get(valueKey);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default List<Object> GET_LIST_OBJ(T key) {
|
||||
return List.class.cast(GET_OBJ(key));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default List<String> GET_LIST_STR(T key) {
|
||||
return List.class.cast(GET_OBJ(key));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default List<Integer> GET_LIST_INT(T key) {
|
||||
return List.class.cast(GET_OBJ(key));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package love.distributedrebirth.bassboon.ydmod.zombie;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface BãßBȍőnEnumZombieBullet {
|
||||
|
||||
String name();
|
||||
|
||||
public static final class AutoFire implements BãßBȍőnEnumZombieBullet {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package love.distributedrebirth.bassboon.ydmod.zombie;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface BãßBȍőnEnumZombieCorpse<K extends BãßBȍőnEnumZombieBullet> extends BãßBȍőnEnumZombie<K> {
|
||||
|
||||
Object PUT_OBJ(K key, Object value);
|
||||
|
||||
default void PUT_MAP(K key) {
|
||||
PUT_OBJ(key, new HashMap<>());
|
||||
}
|
||||
|
||||
default void PUT_LIST(K key) {
|
||||
PUT_OBJ(key, new ArrayList<>());
|
||||
}
|
||||
|
||||
static <K extends BãßBȍőnEnumZombieBullet> BãßBȍőnEnumZombieCorpse<K> castᴼᶠ(BãßBȍőnEnumZombie<K> zombie) {
|
||||
return (BãßBȍőnEnumZombieCorpse<K>) zombie;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package love.distributedrebirth.bassboon.ydmod.zombie;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface BãßBȍőnEnumZombieCorpseLock<K extends BãßBȍőnEnumZombieBullet> extends BãßBȍőnEnumZombieCorpse<K> {
|
||||
|
||||
BãßBȍőnEnumZombie<K> LOCK();
|
||||
|
||||
static <K extends BãßBȍőnEnumZombieBullet> BãßBȍőnEnumZombieCorpseLock<K> castᴼᶠ(BãßBȍőnEnumZombie<K> zombie) {
|
||||
return (BãßBȍőnEnumZombieCorpseLock<K>) zombie;
|
||||
}
|
||||
|
||||
static <Y extends BãßBȍőnEnumZombieBullet> BãßBȍőnEnumZombieCorpseLock<Y> instanceᴺᵉʷ() {
|
||||
Function<Map<Y,Object>,BãßBȍőnEnumZombie<Y>> keyMaker = v -> {
|
||||
Map<Y,Object> frozenFlesh = new HashMap<>(v);
|
||||
for (Y bullet:v.keySet()) {
|
||||
Object deadbeef = frozenFlesh.get(bullet);
|
||||
if (deadbeef instanceof List) {
|
||||
frozenFlesh.put(bullet, Collections.unmodifiableList((List<?>) deadbeef));
|
||||
}
|
||||
if (deadbeef instanceof Map) {
|
||||
frozenFlesh.put(bullet, Collections.unmodifiableMap((Map<?,?>) deadbeef));
|
||||
}
|
||||
}
|
||||
return new BãßBȍőnEnumZombie<>() {
|
||||
@Override
|
||||
public Object GET_OBJ(Y key) {
|
||||
return frozenFlesh.get(key);
|
||||
}
|
||||
};
|
||||
};
|
||||
return new BãßBȍőnEnumZombieCorpseLock<Y>() {
|
||||
private final Map<Y,Object> rottenFlesh = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public BãßBȍőnEnumZombie<Y> LOCK() {
|
||||
return keyMaker.apply(rottenFlesh);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object GET_OBJ(Y key) {
|
||||
return rottenFlesh.get(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object PUT_OBJ(Y key, Object value) {
|
||||
return rottenFlesh.put(key, value);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package love.distributedrebirth.bassboon.ydmod.zombie;
|
||||
|
||||
import love.distributedrebirth.bassboon.BãßBȍőnʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPiratePhase注;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPirateʸᴰ;
|
||||
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnꝐŕḯṿª₮ḕ;
|
||||
|
||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface BãßBȍőnEnumZombieʸᴰ<T extends BãßBȍőnʸᴰ<T>, K extends BãßBȍőnEnumZombieBullet> extends BãßBȍőnʸᴰ<T> {
|
||||
|
||||
@BãßBȍőnPiratePhase注(dependencies = {BãßBȍőnPirateʸᴰ.βrahmanBoonBereshit.class})
|
||||
public static final class Ꝑŕḯṿª₮ḕ implements BãßBȍőnꝐŕḯṿª₮ḕ<BãßBȍőnEnumZombieʸᴰ<?,?>> {
|
||||
private static final String GHOST_ENUM_ZOMBIE = "枚舉殭屍";
|
||||
|
||||
@Override
|
||||
public void init(BãßBȍőnEnumZombieʸᴰ<?,?> boon) {
|
||||
boon.toBBC().UNHOLY_SPELL(Ꝑŕḯṿª₮ḕ.class).PUT_GHOST(GHOST_ENUM_ZOMBIE, BãßBȍőnEnumZombieCorpseLock.instanceᴺᵉʷ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lock(BãßBȍőnEnumZombieʸᴰ<?,?> boon) {
|
||||
BãßBȍőnEnumZombie<?> zombie = boon.toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).GHOST_OBJ(GHOST_ENUM_ZOMBIE, BãßBȍőnEnumZombie.class);
|
||||
zombie = BãßBȍőnEnumZombieCorpseLock.castᴼᶠ(zombie).LOCK();
|
||||
boon.toBBC().UNHOLY_SPELL(Ꝑŕḯṿª₮ḕ.class).PUT_GHOST(GHOST_ENUM_ZOMBIE, zombie);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default BãßBȍőnEnumZombie<K> toEnumZombie() {
|
||||
return toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).GHOST_OBJ(Ꝑŕḯṿª₮ḕ.GHOST_ENUM_ZOMBIE, BãßBȍőnEnumZombie.class);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue