Created DefaultBãßBȍőn interface
This commit is contained in:
parent
3acc28dbbf
commit
2e29efb5fe
78 changed files with 963 additions and 606 deletions
|
|
@ -6,7 +6,7 @@ import java.util.Map;
|
|||
import java.util.function.Consumer;
|
||||
|
||||
@BãßBȍőnAuthorInfoʸᴰ(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface BãßBȍőnCoffinOpenʸᴰ<T extends BãßBȍőnCoffinStoreKeyʸᴰ> extends BãßBȍőnCoffinʸᴰ<T>, DefaultInitMethodʸᴰ {
|
||||
public interface BãßBȍőnCoffinOpenʸᴰ<T extends BãßBȍőnCoffinStoreKeyʸᴰ> extends BãßBȍőnCoffinʸᴰ<T> {
|
||||
|
||||
void LOCK_COFFIN();
|
||||
|
||||
|
|
@ -20,30 +20,56 @@ public interface BãßBȍőnCoffinOpenʸᴰ<T extends BãßBȍőnCoffinStoreKey
|
|||
PUT_OBJ(key, new ArrayList<>());
|
||||
}
|
||||
|
||||
static <T extends DefaultEnumBaseʸᴰ<?> & BãßBȍőnCoffinStoreʸᴰ<?>> void lockCoffin(T store, Consumer<String> logHandler) {
|
||||
static void lockCoffin(DefaultEnumBaseʸᴰ<?,?> store, Consumer<String> logHandler) {
|
||||
logHandler.accept("Lock: "+store.BãßClassNaam()+" since: "+store.BãßAuthorCopyright());
|
||||
for (Object o:store.BãßInstances()) {
|
||||
BãßBȍőnCoffinStoreʸᴰ<?> coffin = BãßBȍőnCoffinStoreʸᴰ.class.cast(o);
|
||||
BãßBȍőnCoffinStoreʸᴰ<?, ?> coffin = BãßBȍőnCoffinStoreʸᴰ.class.cast(o);
|
||||
BãßBȍőnCoffinOpenʸᴰ<?> coffinOpen = BãßBȍőnCoffinOpenʸᴰ.class.cast(coffin.GET_BBC());
|
||||
coffinOpen.LOCK_COFFIN();
|
||||
}
|
||||
}
|
||||
|
||||
static class BãßBȍőnFamilyGrave implements BãßBȍőnCoffinGhostʸᴰ {
|
||||
final Map<String,Object> ghosts = new HashMap<>();
|
||||
volatile boolean deathLock = false;
|
||||
|
||||
public void LOCK_GHOST() {
|
||||
deathLock = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object PUT_GHOST(String key, Object value) {
|
||||
if (deathLock) {
|
||||
throw new IllegalStateException("Can't restore body of family ghost.");
|
||||
}
|
||||
return ghosts.put(key, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object GHOST_OBJ(String key) {
|
||||
return ghosts.get(key);
|
||||
}
|
||||
}
|
||||
|
||||
static <Y extends BãßBȍőnCoffinStoreKeyʸᴰ> BãßBȍőnCoffinOpenʸᴰ<Y> newInstance() {
|
||||
return new BãßBȍőnCoffinOpenʸᴰ<Y>() {
|
||||
final Map<Y,Object> initMap = new HashMap<>();
|
||||
final Map<Class<?>,BãßBȍőnFamilyGrave> familyGrave = new HashMap<>();
|
||||
volatile boolean deathLock = false;
|
||||
|
||||
@Override
|
||||
public void LOCK_COFFIN() {
|
||||
deathLock = true;
|
||||
for (BãßBȍőnFamilyGrave grave:familyGrave.values()) {
|
||||
grave.LOCK_GHOST();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object GET_OBJ(Y key) {
|
||||
return initMap.get(key);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object PUT_OBJ(Y key, Object value) {
|
||||
if (deathLock) {
|
||||
|
|
@ -51,6 +77,16 @@ public interface BãßBȍőnCoffinOpenʸᴰ<T extends BãßBȍőnCoffinStoreKey
|
|||
}
|
||||
return initMap.put(key, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BãßBȍőnCoffinGhostʸᴰ UNHOLY(Class<?> familyName) {
|
||||
BãßBȍőnFamilyGrave familyGhosts = familyGrave.get(familyName);
|
||||
if (familyGhosts == null) {
|
||||
familyGhosts = new BãßBȍőnFamilyGrave();
|
||||
familyGrave.put(familyName, familyGhosts);
|
||||
}
|
||||
return familyGhosts;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue