feat(muscript): support custom dynamic implementations via DynamicBase
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
b91e15e352
commit
935d6f9cf6
|
@ -17,7 +17,7 @@ import java.io.IOException;
|
|||
* Override toString(StringBuilder) to support custom serialization (note: the serialized form is ran with muScript to generate the tree)
|
||||
* @param <T> the type represented
|
||||
*/
|
||||
public sealed interface Dynamic<T> permits DBool, DNumber, DString, DObject, DList, DCallable, DNull, DContainer {
|
||||
public sealed interface Dynamic<T> permits DBool, DCallable, DList, DNull, DNumber, DObject, DString, DynamicBase {
|
||||
/**
|
||||
* Deserialize simply dynamic values. DOES NOT SUPPORT CALLABLES!
|
||||
* Use Parser.parse() if you truly need to deserialize them, but be aware that that might enable DOS attacks
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
package io.gitlab.jfronny.muscript.data.dynamic;
|
||||
|
||||
/**
|
||||
* Use this for ABSTRACT (!) implementations of custom dynamic containers.
|
||||
* Any concrete implementation MUST still implement a valid Dynamic subtype (DBool, DString, ...)
|
||||
* @param <T> the type represented
|
||||
*/
|
||||
public non-sealed interface DynamicBase<T> extends Dynamic<T> {
|
||||
}
|
|
@ -1,8 +1,9 @@
|
|||
package io.gitlab.jfronny.muscript.data.dynamic.additional;
|
||||
|
||||
import io.gitlab.jfronny.muscript.data.dynamic.Dynamic;
|
||||
import io.gitlab.jfronny.muscript.data.dynamic.DynamicBase;
|
||||
|
||||
public abstract non-sealed class DContainer<T> implements Dynamic<T> {
|
||||
public abstract class DContainer<T> implements DynamicBase<T> {
|
||||
private T value;
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue
Block a user