Added BãßBȍőnCoffinOpen
This commit is contained in:
parent
645a10ef4c
commit
2ae7e1f0a7
26 changed files with 347 additions and 261 deletions
|
|
@ -1,17 +0,0 @@
|
|||
package love.distributedrebirth.bassboonyd;
|
||||
|
||||
/**
|
||||
* Inject Enum methods.
|
||||
*
|
||||
* @author willemtsade ©Δ∞ 仙上主天
|
||||
*/
|
||||
public interface BaßBȍőnEnumʸᴰ<T> {
|
||||
|
||||
int ordinal();
|
||||
|
||||
String name();
|
||||
|
||||
default String naam() {
|
||||
return name(); // Deutsche code
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package love.distributedrebirth.bassboonyd;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface BãßBȍőnCoffin<T extends BãßBȍőnStoreKeyʸᴰ> {
|
||||
|
||||
Object GET_OBJ(T 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));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default Map<String,String> GET_MAP_STR(T key) {
|
||||
return Map.class.cast(GET_OBJ(key));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default Map<String,Integer> GET_MAP_INT(T key) {
|
||||
return Map.class.cast(GET_OBJ(key));
|
||||
}
|
||||
|
||||
@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,33 @@
|
|||
package love.distributedrebirth.bassboonyd;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public interface BãßBȍőnCoffinOpen<T extends BãßBȍőnStoreKeyʸᴰ> extends BãßBȍőnCoffin<T> {
|
||||
|
||||
Object PUT_OBJ(T key, Object value);
|
||||
|
||||
default void PUT_MAP(T key) {
|
||||
PUT_OBJ(key, new HashMap<>());
|
||||
}
|
||||
|
||||
default void PUT_LIST(T key) {
|
||||
PUT_OBJ(key, new HashMap<>());
|
||||
}
|
||||
|
||||
static <Y extends BãßBȍőnStoreKeyʸᴰ> BãßBȍőnCoffinOpen<Y> newInstance() {
|
||||
return new BãßBȍőnCoffinOpen<Y>() {
|
||||
final Map<Y,Object> initMap = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public Object GET_OBJ(Y key) {
|
||||
return initMap.get(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object PUT_OBJ(Y key, Object value) {
|
||||
return initMap.put(key, value);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package love.distributedrebirth.bassboonyd;
|
||||
|
||||
public class BãßBȍőnConstants {
|
||||
|
||||
public static final String STR_VALUES = "values";
|
||||
|
||||
public static final String STR_DOT = ".";
|
||||
}
|
||||
|
|
@ -11,12 +11,22 @@ import java.util.stream.Stream;
|
|||
*
|
||||
* @author willemtsade ©Δ∞ 仙上主天
|
||||
*/
|
||||
public interface BaßBȍőnEnumSetʸᴰ<T> extends BaßBȍőnEnumʸᴰ<T> {
|
||||
public interface BãßBȍőnEnumSetʸᴰ<T> extends BãßBȍőnEnumʸᴰ<T> {
|
||||
|
||||
int ordinal();
|
||||
|
||||
default int dingRangTelNul() {
|
||||
return ordinal();
|
||||
}
|
||||
|
||||
default int dingRangTelEen() {
|
||||
return ordinal() + 1;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default T[] staticInstances() {
|
||||
try {
|
||||
Object result = getClass().getMethod("values").invoke(null);
|
||||
Object result = getClass().getMethod(BãßBȍőnConstants.STR_VALUES).invoke(null);
|
||||
return (T[]) result;
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package love.distributedrebirth.bassboonyd;
|
||||
|
||||
/**
|
||||
* Inject Enum methods.
|
||||
*
|
||||
* @author willemtsade ©Δ∞ 仙上主天
|
||||
*/
|
||||
public interface BãßBȍőnEnumʸᴰ<T> {
|
||||
|
||||
String name();
|
||||
|
||||
default String BȍőnNaam() {
|
||||
return name();
|
||||
}
|
||||
|
||||
default String BȍőnNaamI18N() {
|
||||
return BãßNaam() + BãßBȍőnConstants.STR_DOT + name();
|
||||
}
|
||||
|
||||
default String BãßNaam() {
|
||||
return getClass().getAnnotation(BãßBȍőnNaamʸᴰ.class).value();
|
||||
}
|
||||
}
|
||||
|
|
@ -12,7 +12,7 @@ import java.lang.annotation.Target;
|
|||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.TYPE})
|
||||
public @interface BaßBȍőnNaamʸᴰ {
|
||||
public @interface BãßBȍőnNaamʸᴰ {
|
||||
|
||||
String value();
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package love.distributedrebirth.bassboonyd;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author willemtsade ©Δ∞ 仙上主天
|
||||
*/
|
||||
public interface BãßBȍőnStore<T extends BãßBȍőnStoreKeyʸᴰ> {
|
||||
|
||||
BãßBȍőnCoffin<T> GET_BBC();
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
package love.distributedrebirth.bassboonyd;
|
||||
|
||||
public interface BãßBȍőnStoreKeyʸᴰ {
|
||||
|
||||
String name();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue