Moved copyright to runtime env

This commit is contained in:
Willem Cazander 2022-02-02 18:01:10 +01:00
parent 2ae7e1f0a7
commit d1b7c5fabc
25 changed files with 231 additions and 204 deletions

View file

@ -0,0 +1,16 @@
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.TYPE})
public @interface BãßBȍőnAuthorInfoʸᴰ {
String name();
String copyright();
}

View file

@ -3,6 +3,7 @@ package love.distributedrebirth.bassboonyd;
import java.util.List;
import java.util.Map;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface BãßBȍőnCoffin<T extends BãßBȍőnStoreKeyʸᴰ> {
Object GET_OBJ(T key);

View file

@ -3,6 +3,7 @@ package love.distributedrebirth.bassboonyd;
import java.util.HashMap;
import java.util.Map;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface BãßBȍőnCoffinOpen<T extends BãßBȍőnStoreKeyʸᴰ> extends BãßBȍőnCoffin<T> {
Object PUT_OBJ(T key, Object value);

View file

@ -1,8 +1,13 @@
package love.distributedrebirth.bassboonyd;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class BãßBȍőnConstants {
public static final String STR_VALUES = "values";
public static final String STR_DOT = ".";
public static final int INT_ZERO = 0;
public static final int INT_ONE = 1;
}

View file

@ -0,0 +1,15 @@
package love.distributedrebirth.bassboonyd;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface BãßBȍőnEnumInstanceʸᴰ<T> extends BãßBȍőnEnumʸᴰ<T> {
int ordinal();
default T BȍőnInstance() {
return BãßInstances()[ordinal()];
}
default T BãßInstance() {
return BãßInstances()[BãßBȍőnConstants.INT_ZERO];
}
}

View file

@ -6,47 +6,33 @@ import java.util.List;
import java.util.function.Consumer;
import java.util.stream.Stream;
/**
* Inject EnumSet methods.
*
* @author willemtsade ©Δ 仙上主天
*/
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface BãßBȍőnEnumSetʸᴰ<T> extends BãßBȍőnEnumʸᴰ<T> {
int ordinal();
default int dingRangTelNul() {
default int BȍőnRangTelNul() {
return ordinal();
}
default int dingRangTelEen() {
default int BȍőnRangTelEen() {
return ordinal() + 1;
}
@SuppressWarnings("unchecked")
default T[] staticInstances() {
try {
Object result = getClass().getMethod(BãßBȍőnConstants.STR_VALUES).invoke(null);
return (T[]) result;
} catch (Exception e) {
throw new RuntimeException(e);
}
default List<T> BãßInstancesList() {
return Arrays.asList(BãßInstances());
}
default List<T> staticInstancesList() {
return Arrays.asList(staticInstances());
default Iterator<T> BãßInstancesIterator() {
return BãßInstancesList().iterator();
}
default Iterator<T> staticInstancesIterator() {
return staticInstancesList().iterator();
default Stream<T> BãßInstancesStream() {
return BãßInstancesList().stream();
}
default Stream<T> staticInstancesStream() {
return staticInstancesList().stream();
}
default T volgende() {
T[] values = staticInstances();
default T BȍőnVolgende() {
T[] values = BãßInstances();
int resultIndex = 0;
for (int i=0;i<values.length;i++) {
if (this == values[i]) {
@ -60,8 +46,8 @@ public interface BãßBȍőnEnumSetʸᴰ<T> extends BãßBȍőnEnumʸᴰ<T> {
return values[resultIndex];
}
default T vorige() {
T[] values = staticInstances();
default T BȍőnVorige() {
T[] values = BãßInstances();
int resultIndex = 0;
for (int i=0;i<values.length;i++) {
if (this == values[i]) {
@ -76,7 +62,7 @@ public interface BãßBȍőnEnumSetʸᴰ<T> extends BãßBȍőnEnumʸᴰ<T> {
}
default void staticVoorElk(Consumer<T> consumer) {
for (T value:staticInstances()) {
for (T value:BãßInstances()) {
consumer.accept(value);
}
}

View file

@ -1,10 +1,6 @@
package love.distributedrebirth.bassboonyd;
/**
* Inject Enum methods.
*
* @author willemtsade ©Δ 仙上主天
*/
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface BãßBȍőnEnumʸᴰ<T> {
String name();
@ -18,6 +14,16 @@ public interface BãßBȍőnEnumʸᴰ<T> {
}
default String BãßNaam() {
return getClass().getAnnotation(BãßBȍőnNaamʸᴰ.class).value();
return getClass().getAnnotation(BãßBȍőnInfoʸᴰ.class).name();
}
@SuppressWarnings("unchecked")
default T[] BãßInstances() {
try {
Object result = getClass().getMethod(BãßBȍőnConstants.STR_VALUES).invoke(null);
return (T[]) result;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}

View file

@ -5,14 +5,12 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Defines the BaßBȍőn name.
*
* @author willemtsade ©Δ 仙上主天
*/
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
public @interface BãßBȍőnNaamʸᴰ {
public @interface BãßBȍőnInfoʸᴰ {
String value();
String name();
String purpose();
}

View file

@ -1,10 +1,6 @@
package love.distributedrebirth.bassboonyd;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface BãßBȍőnStore<T extends BãßBȍőnStoreKeyʸᴰ> {
BãßBȍőnCoffin<T> GET_BBC();

View file

@ -1,5 +1,6 @@
package love.distributedrebirth.bassboonyd;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface BãßBȍőnStoreKeyʸᴰ {
String name();