ObjectWrappers

用于创建 ObjectWrapper 的工具接口,提供了一系列将原生对象转换为脚本可用的 Wrapper 对象的方法。

Author

M8Test, [email protected], https://m8test.com

Functions

Link copied to clipboard
abstract fun getGlobalName(): String

获取作为全局变量时的名称.

Link copied to clipboard
abstract fun getPublicType(): Type

获取 Variable 注入到脚本时需要显示的类型.

Link copied to clipboard
abstract fun isPrefixRequired(): Boolean

是否需要添加前缀, 每种编程语言添加的前缀不一样, 前缀可以通过 Language.getVariablePrefix 获取.

Link copied to clipboard
abstract fun isSuffixRequired(): Boolean

是否需要添加后缀, 每种编程语言添加的后缀不一样, 后缀可以通过 Language.getVariableSuffix 获取.

Link copied to clipboard
abstract fun <T> wrap(origin: T): ObjectWrapper<T>

根据传入的对象自动判断类型并包装成对应的 ObjectWrapper 对象。

Link copied to clipboard
abstract fun <T> wrapArray(origin: Array<T>): ArrayWrapper<T>

将原生数组包装为 ArrayWrapper

Link copied to clipboard

将原生 BooleanArray 包装为 BooleanArrayWrapper

Link copied to clipboard

将原生 ByteArray 包装为 ByteArrayWrapper

Link copied to clipboard

将原生 CharArray 包装为 CharArrayWrapper

Link copied to clipboard

将原生 CharSequence 包装为 CharSequenceWrapper

Link copied to clipboard
abstract fun <T> wrapCollection(origin: Collection<T>): CollectionWrapper<T>

将原生 Collection(只读)包装为 CollectionWrapper

Link copied to clipboard

将原生 DoubleArray 包装为 DoubleArrayWrapper

Link copied to clipboard

将原生 FloatArray 包装为 FloatArrayWrapper

Link copied to clipboard
abstract fun <T, K> wrapGrouping(origin: Grouping<T, K>): GroupingWrapper<T, K>

将原生 Grouping 包装为 GroupingWrapper

Link copied to clipboard
abstract fun wrapIntArray(origin: IntArray): IntArrayWrapper

将原生 IntArray 包装为 IntArrayWrapper

Link copied to clipboard
abstract fun <T> wrapIterable(origin: Iterable<T>): IterableWrapper<T>

将原生 Iterable 包装为 IterableWrapper

Link copied to clipboard
abstract fun <T> wrapList(origin: List<T>): ListWrapper<T>

将原生 List(只读)包装为 ListWrapper

Link copied to clipboard

将原生 LongArray 包装为 LongArrayWrapper

Link copied to clipboard
abstract fun <K, V> wrapMap(origin: Map<K, V>): MapWrapper<K, V>

将原生 Map(只读)包装为 MapWrapper

Link copied to clipboard

将原生 MutableCollection(可变)包装为 MutableCollectionWrapper

Link copied to clipboard
abstract fun <T> wrapMutableList(origin: MutableList<T>): MutableListWrapper<T>

将原生 MutableList(可变)包装为 MutableListWrapper

Link copied to clipboard
abstract fun <K, V> wrapMutableMap(origin: MutableMap<K, V>): MutableMapWrapper<K, V>

将原生 MutableMap(可变)包装为 MutableMapWrapper

Link copied to clipboard
abstract fun <T> wrapMutableSet(origin: MutableSet<T>): MutableSetWrapper<T>

将原生 MutableSet(可变)包装为 MutableSetWrapper

Link copied to clipboard
abstract fun <A, B> wrapPair(origin: Pair<A, B>): PairWrapper<A, B>

将原生 Pair 包装为 PairWrapper

Link copied to clipboard
abstract fun <T> wrapSequence(origin: Sequence<T>): SequenceWrapper<T>

将原生 Sequence 包装为 SequenceWrapper

Link copied to clipboard
abstract fun <T> wrapSet(origin: Set<T>): SetWrapper<T>

将原生 Set(只读)包装为 SetWrapper

Link copied to clipboard

将原生 ShortArray 包装为 ShortArrayWrapper

Link copied to clipboard
abstract fun wrapString(origin: String): StringWrapper

将原生字符串包装为 StringWrapper