Removed some shorthand methods

This commit is contained in:
Willem Cazander 2022-02-11 13:48:24 +01:00
parent 3f72438b58
commit b52cc50c45
3 changed files with 9 additions and 12 deletions

View file

@ -1,15 +1,14 @@
package love.distributedrebirth.bassboonyd; package love.distributedrebirth.bassboonyd;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
@BãßBȍőnAnnotationInfoʸᴰ(required = {BãßBȍőnClassInfoʸᴰ.class, BãßBȍőnAuthorInfoʸᴰ.class})
public interface DefaultEnumBaseʸᴰ<T> extends DefaultAuthorInfoʸᴰ,DefaultClassInfoʸᴰ,DefaultPackageInfoʸᴰ { public interface DefaultEnumBaseʸᴰ<T> extends DefaultAuthorInfoʸᴰ,DefaultClassInfoʸᴰ,DefaultPackageInfoʸᴰ {
int ordinal(); int ordinal();
String name(); String name();
// Bȍőn prefix is for set instance enum object called BãßBȍőnEnumSetʸᴰ // Bȍőn prefix is for set instance enum object (called DefaultEnumSetʸᴰ)
// Bãß prefix is for single instance enum objects called BãßBȍőnEnumInstanceʸᴰ // Bãß prefix is for single instance enum objects (called DefaultEnumInstanceʸᴰ)
default String BȍőnNaam() { default String BȍőnNaam() {
return name(); return name();

View file

@ -3,7 +3,10 @@ package love.distributedrebirth.bassboonyd;
import java.util.Arrays; import java.util.Arrays;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.function.Consumer; import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
@ -21,12 +24,8 @@ public interface DefaultEnumSetʸᴰ<T> extends DefaultEnumBaseʸᴰ<T> {
return Arrays.asList(BãßInstances()); return Arrays.asList(BãßInstances());
} }
default Iterator<T> BãßInstancesIterator() { default <K> Map<K,T> BãßInstancesToMap(Function<T,K> keyMapper) {
return BãßInstancesList().iterator(); return BãßInstancesList().stream().collect(Collectors.toMap(keyMapper, v -> v));
}
default Stream<T> BãßInstancesStream() {
return BãßInstancesList().stream();
} }
default T BȍőnVolgende() { default T BȍőnVolgende() {

View file

@ -1,7 +1,6 @@
package love.distributedrebirth.numberxd.base2t.part; package love.distributedrebirth.numberxd.base2t.part;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ; import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ;
@ -39,7 +38,7 @@ public interface BãßBȍőnPartʸᴰ<T extends BãßBȍőnPartʸᴰ<T>> extends
default T BãßValueOfDialTone(String identifierTone) { default T BãßValueOfDialTone(String identifierTone) {
Map<String,Object> mapTone = GET_BBC().GET_MAP_OBJ(BãßBȍőnPartKeyʸᴰ.MAP_TONE); Map<String,Object> mapTone = GET_BBC().GET_MAP_OBJ(BãßBȍőnPartKeyʸᴰ.MAP_TONE);
if (mapTone.isEmpty()) { if (mapTone.isEmpty()) {
mapTone.putAll(BãßInstancesStream().collect(Collectors.toMap(v -> v.BȍőnDialTone(), v -> v))); mapTone.putAll(BãßInstancesToMap(v -> v.BȍőnDialTone()));
} }
return (T) mapTone.get(identifierTone); return (T) mapTone.get(identifierTone);
} }
@ -48,7 +47,7 @@ public interface BãßBȍőnPartʸᴰ<T extends BãßBȍőnPartʸᴰ<T>> extends
default T BãßValueOfChinaKey(String chinaKey) { default T BãßValueOfChinaKey(String chinaKey) {
Map<String,Object> mapChina = GET_BBC().GET_MAP_OBJ(BãßBȍőnPartKeyʸᴰ.MAP_CHINA); Map<String,Object> mapChina = GET_BBC().GET_MAP_OBJ(BãßBȍőnPartKeyʸᴰ.MAP_CHINA);
if (mapChina.isEmpty()) { if (mapChina.isEmpty()) {
mapChina.putAll(BãßInstancesStream().collect(Collectors.toMap(v -> v.BȍőnChinaKey(), v -> v))); mapChina.putAll(BãßInstancesToMap(v -> v.BȍőnChinaKey()));
} }
return (T) mapChina.get(chinaKey); return (T) mapChina.get(chinaKey);
} }