diff --git a/src/main/kotlin/app/revanced/patcher/patch/options/types/BooleanPatchOption.kt b/src/main/kotlin/app/revanced/patcher/patch/options/types/BooleanPatchOption.kt index 471478c..7d808cd 100644 --- a/src/main/kotlin/app/revanced/patcher/patch/options/types/BooleanPatchOption.kt +++ b/src/main/kotlin/app/revanced/patcher/patch/options/types/BooleanPatchOption.kt @@ -11,6 +11,7 @@ import app.revanced.patcher.patch.options.PatchOption * @param title The title. * @param description A description. * @param required Whether the option is required. + * @param validate The function to validate values of the option. * * @see PatchOption */ @@ -20,8 +21,8 @@ class BooleanPatchOption private constructor( title: String?, description: String?, required: Boolean, - validator: (Boolean?) -> Boolean -) : PatchOption(key, default, title, description, required, validator) { + validate: (Boolean?) -> Boolean +) : PatchOption(key, default, title, description, required, validate) { companion object { /** * Create a new [BooleanPatchOption] and add it to the current [Patch]. @@ -42,7 +43,7 @@ class BooleanPatchOption private constructor( title: String? = null, description: String? = null, required: Boolean = false, - validator: (Boolean?) -> Boolean = { true } - ) = BooleanPatchOption(key, default, title, description, required, validator).also { options.register(it) } + validate: (Boolean?) -> Boolean = { true } + ) = BooleanPatchOption(key, default, title, description, required, validate).also { options.register(it) } } } diff --git a/src/main/kotlin/app/revanced/patcher/patch/options/types/FloatPatchOption.kt b/src/main/kotlin/app/revanced/patcher/patch/options/types/FloatPatchOption.kt index beec13a..6beb874 100644 --- a/src/main/kotlin/app/revanced/patcher/patch/options/types/FloatPatchOption.kt +++ b/src/main/kotlin/app/revanced/patcher/patch/options/types/FloatPatchOption.kt @@ -11,6 +11,7 @@ import app.revanced.patcher.patch.options.PatchOption * @param title The title. * @param description A description. * @param required Whether the option is required. + * @param validate The function to validate values of the option. * * @see PatchOption */ @@ -20,8 +21,8 @@ class FloatPatchOption private constructor( title: String?, description: String?, required: Boolean, - validator: (Float?) -> Boolean -) : PatchOption(key, default, title, description, required, validator) { + validate: (Float?) -> Boolean +) : PatchOption(key, default, title, description, required, validate) { companion object { /** * Create a new [FloatPatchOption] and add it to the current [Patch]. @@ -31,6 +32,8 @@ class FloatPatchOption private constructor( * @param title The title. * @param description A description. * @param required Whether the option is required. + * @param validate The function to validate values of the option. + * * @return The created [FloatPatchOption]. * * @see FloatPatchOption @@ -42,7 +45,7 @@ class FloatPatchOption private constructor( title: String? = null, description: String? = null, required: Boolean = false, - validator: (Float?) -> Boolean = { true } - ) = FloatPatchOption(key, default, title, description, required, validator).also { options.register(it) } + validate: (Float?) -> Boolean = { true } + ) = FloatPatchOption(key, default, title, description, required, validate).also { options.register(it) } } } diff --git a/src/main/kotlin/app/revanced/patcher/patch/options/types/IntPatchOption.kt b/src/main/kotlin/app/revanced/patcher/patch/options/types/IntPatchOption.kt index c815b59..21f5344 100644 --- a/src/main/kotlin/app/revanced/patcher/patch/options/types/IntPatchOption.kt +++ b/src/main/kotlin/app/revanced/patcher/patch/options/types/IntPatchOption.kt @@ -11,6 +11,7 @@ import app.revanced.patcher.patch.options.PatchOption * @param title The title. * @param description A description. * @param required Whether the option is required. + * @param validate The function to validate values of the option. * * @see PatchOption */ @@ -20,8 +21,8 @@ class IntPatchOption private constructor( title: String?, description: String?, required: Boolean, - validator: (Int?) -> Boolean -) : PatchOption(key, default, title, description, required, validator) { + validate: (Int?) -> Boolean +) : PatchOption(key, default, title, description, required, validate) { companion object { /** * Create a new [IntPatchOption] and add it to the current [Patch]. @@ -31,6 +32,8 @@ class IntPatchOption private constructor( * @param title The title. * @param description A description. * @param required Whether the option is required. + * @param validate The function to validate values of the option. + * * @return The created [IntPatchOption]. * * @see IntPatchOption @@ -42,7 +45,7 @@ class IntPatchOption private constructor( title: String? = null, description: String? = null, required: Boolean = false, - validator: (Int?) -> Boolean = { true } - ) = IntPatchOption(key, default, title, description, required, validator).also { options.register(it) } + validate: (Int?) -> Boolean = { true } + ) = IntPatchOption(key, default, title, description, required, validate).also { options.register(it) } } } diff --git a/src/main/kotlin/app/revanced/patcher/patch/options/types/LongPatchOption.kt b/src/main/kotlin/app/revanced/patcher/patch/options/types/LongPatchOption.kt index 563fa21..15702d0 100644 --- a/src/main/kotlin/app/revanced/patcher/patch/options/types/LongPatchOption.kt +++ b/src/main/kotlin/app/revanced/patcher/patch/options/types/LongPatchOption.kt @@ -11,6 +11,7 @@ import app.revanced.patcher.patch.options.PatchOption * @param title The title. * @param description A description. * @param required Whether the option is required. + * @param validate The function to validate values of the option. * * @see PatchOption */ @@ -20,8 +21,8 @@ class LongPatchOption private constructor( title: String?, description: String?, required: Boolean, - validator: (Long?) -> Boolean -) : PatchOption(key, default, title, description, required, validator) { + validate: (Long?) -> Boolean +) : PatchOption(key, default, title, description, required, validate) { companion object { /** * Create a new [LongPatchOption] and add it to the current [Patch]. @@ -42,7 +43,7 @@ class LongPatchOption private constructor( title: String? = null, description: String? = null, required: Boolean = false, - validator: (Long?) -> Boolean = { true } - ) = LongPatchOption(key, default, title, description, required, validator).also { options.register(it) } + validate: (Long?) -> Boolean = { true } + ) = LongPatchOption(key, default, title, description, required, validate).also { options.register(it) } } } diff --git a/src/main/kotlin/app/revanced/patcher/patch/options/types/StringPatchOption.kt b/src/main/kotlin/app/revanced/patcher/patch/options/types/StringPatchOption.kt index 5e2677f..dc21c74 100644 --- a/src/main/kotlin/app/revanced/patcher/patch/options/types/StringPatchOption.kt +++ b/src/main/kotlin/app/revanced/patcher/patch/options/types/StringPatchOption.kt @@ -11,6 +11,7 @@ import app.revanced.patcher.patch.options.PatchOption * @param title The title. * @param description A description. * @param required Whether the option is required. + * @param validate The function to validate values of the option. * * @see PatchOption */ @@ -20,8 +21,8 @@ class StringPatchOption private constructor( title: String?, description: String?, required: Boolean, - validator: (String?) -> Boolean -) : PatchOption(key, default, title, description, required, validator) { + validate: (String?) -> Boolean +) : PatchOption(key, default, title, description, required, validate) { companion object { /** * Create a new [StringPatchOption] and add it to the current [Patch]. @@ -31,6 +32,8 @@ class StringPatchOption private constructor( * @param title The title. * @param description A description. * @param required Whether the option is required. + * @param validate The function to validate values of the option. + * * @return The created [StringPatchOption]. * * @see StringPatchOption @@ -42,7 +45,7 @@ class StringPatchOption private constructor( title: String? = null, description: String? = null, required: Boolean = false, - validator: (String?) -> Boolean = { true } - ) = StringPatchOption(key, default, title, description, required, validator).also { options.register(it) } + validate: (String?) -> Boolean = { true } + ) = StringPatchOption(key, default, title, description, required, validate).also { options.register(it) } } } diff --git a/src/main/kotlin/app/revanced/patcher/patch/options/types/array/BooleanArrayPatchOption.kt b/src/main/kotlin/app/revanced/patcher/patch/options/types/array/BooleanArrayPatchOption.kt index 84bd809..52dceaf 100644 --- a/src/main/kotlin/app/revanced/patcher/patch/options/types/array/BooleanArrayPatchOption.kt +++ b/src/main/kotlin/app/revanced/patcher/patch/options/types/array/BooleanArrayPatchOption.kt @@ -11,6 +11,7 @@ import app.revanced.patcher.patch.options.PatchOption * @param title The title. * @param description A description. * @param required Whether the option is required. + * @param validate The function to validate values of the option. * * @see PatchOption */ @@ -20,8 +21,8 @@ class BooleanArrayPatchOption private constructor( title: String?, description: String?, required: Boolean, - validator: (Array?) -> Boolean -) : PatchOption>(key, default, title, description, required, validator) { + validate: (Array?) -> Boolean +) : PatchOption>(key, default, title, description, required, validate) { companion object { /** * Create a new [BooleanArrayPatchOption] and add it to the current [Patch]. @@ -31,6 +32,8 @@ class BooleanArrayPatchOption private constructor( * @param title The title. * @param description A description. * @param required Whether the option is required. + * @param validate The function to validate values of the option. + * * @return The created [BooleanArrayPatchOption]. * * @see BooleanArrayPatchOption @@ -42,7 +45,7 @@ class BooleanArrayPatchOption private constructor( title: String? = null, description: String? = null, required: Boolean = false, - validator: (Array?) -> Boolean = { true } - ) = BooleanArrayPatchOption(key, default, title, description, required, validator).also { options.register(it) } + validate: (Array?) -> Boolean = { true } + ) = BooleanArrayPatchOption(key, default, title, description, required, validate).also { options.register(it) } } } diff --git a/src/main/kotlin/app/revanced/patcher/patch/options/types/array/FloatArrayPatchOption.kt b/src/main/kotlin/app/revanced/patcher/patch/options/types/array/FloatArrayPatchOption.kt index c9e829d..83d950e 100644 --- a/src/main/kotlin/app/revanced/patcher/patch/options/types/array/FloatArrayPatchOption.kt +++ b/src/main/kotlin/app/revanced/patcher/patch/options/types/array/FloatArrayPatchOption.kt @@ -11,6 +11,7 @@ import app.revanced.patcher.patch.options.PatchOption * @param title The title. * @param description A description. * @param required Whether the option is required. + * @param validate The function to validate values of the option. * * @see PatchOption */ @@ -20,8 +21,8 @@ class FloatArrayPatchOption private constructor( title: String?, description: String?, required: Boolean, - validator: (Array?) -> Boolean -) : PatchOption>(key, default, title, description, required, validator) { + validate: (Array?) -> Boolean +) : PatchOption>(key, default, title, description, required, validate) { companion object { /** * Create a new [FloatArrayPatchOption] and add it to the current [Patch]. @@ -31,6 +32,8 @@ class FloatArrayPatchOption private constructor( * @param title The title. * @param description A description. * @param required Whether the option is required. + * @param validate The function to validate values of the option. + * * @return The created [FloatArrayPatchOption]. * * @see FloatArrayPatchOption @@ -42,7 +45,7 @@ class FloatArrayPatchOption private constructor( title: String? = null, description: String? = null, required: Boolean = false, - validator: (Array?) -> Boolean = { true } - ) = FloatArrayPatchOption(key, default, title, description, required, validator).also { options.register(it) } + validate: (Array?) -> Boolean = { true } + ) = FloatArrayPatchOption(key, default, title, description, required, validate).also { options.register(it) } } } diff --git a/src/main/kotlin/app/revanced/patcher/patch/options/types/array/IntArrayPatchOption.kt b/src/main/kotlin/app/revanced/patcher/patch/options/types/array/IntArrayPatchOption.kt index 28211cf..18d8a2d 100644 --- a/src/main/kotlin/app/revanced/patcher/patch/options/types/array/IntArrayPatchOption.kt +++ b/src/main/kotlin/app/revanced/patcher/patch/options/types/array/IntArrayPatchOption.kt @@ -11,6 +11,7 @@ import app.revanced.patcher.patch.options.PatchOption * @param title The title. * @param description A description. * @param required Whether the option is required. + * @param validate The function to validate values of the option. * * @see PatchOption */ @@ -20,8 +21,8 @@ class IntArrayPatchOption private constructor( title: String?, description: String?, required: Boolean, - validator: (Array?) -> Boolean -) : PatchOption>(key, default, title, description, required, validator) { + validate: (Array?) -> Boolean +) : PatchOption>(key, default, title, description, required, validate) { companion object { /** * Create a new [IntArrayPatchOption] and add it to the current [Patch]. @@ -31,6 +32,8 @@ class IntArrayPatchOption private constructor( * @param title The title. * @param description A description. * @param required Whether the option is required. + * @param validate The function to validate values of the option. + * * @return The created [IntArrayPatchOption]. * * @see IntArrayPatchOption @@ -42,7 +45,7 @@ class IntArrayPatchOption private constructor( title: String? = null, description: String? = null, required: Boolean = false, - validator: (Array?) -> Boolean = { true } - ) = IntArrayPatchOption(key, default, title, description, required, validator).also { options.register(it) } + validate: (Array?) -> Boolean = { true } + ) = IntArrayPatchOption(key, default, title, description, required, validate).also { options.register(it) } } } diff --git a/src/main/kotlin/app/revanced/patcher/patch/options/types/array/LongArrayPatchOption.kt b/src/main/kotlin/app/revanced/patcher/patch/options/types/array/LongArrayPatchOption.kt index babb690..93a7ad8 100644 --- a/src/main/kotlin/app/revanced/patcher/patch/options/types/array/LongArrayPatchOption.kt +++ b/src/main/kotlin/app/revanced/patcher/patch/options/types/array/LongArrayPatchOption.kt @@ -11,6 +11,7 @@ import app.revanced.patcher.patch.options.PatchOption * @param title The title. * @param description A description. * @param required Whether the option is required. + * @param validate The function to validate values of the option. * * @see PatchOption */ @@ -20,8 +21,8 @@ class LongArrayPatchOption private constructor( title: String?, description: String?, required: Boolean, - validator: (Array?) -> Boolean -) : PatchOption>(key, default, title, description, required, validator) { + validate: (Array?) -> Boolean +) : PatchOption>(key, default, title, description, required, validate) { companion object { /** * Create a new [LongArrayPatchOption] and add it to the current [Patch]. @@ -31,6 +32,8 @@ class LongArrayPatchOption private constructor( * @param title The title. * @param description A description. * @param required Whether the option is required. + * @param validate The function to validate values of the option. + * * @return The created [LongArrayPatchOption]. * * @see LongArrayPatchOption @@ -42,7 +45,7 @@ class LongArrayPatchOption private constructor( title: String? = null, description: String? = null, required: Boolean = false, - validator: (Array?) -> Boolean = { true } - ) = LongArrayPatchOption(key, default, title, description, required, validator).also { options.register(it) } + validate: (Array?) -> Boolean = { true } + ) = LongArrayPatchOption(key, default, title, description, required, validate).also { options.register(it) } } } diff --git a/src/main/kotlin/app/revanced/patcher/patch/options/types/array/StringArrayPatchOption.kt b/src/main/kotlin/app/revanced/patcher/patch/options/types/array/StringArrayPatchOption.kt index a73053c..ccab4a1 100644 --- a/src/main/kotlin/app/revanced/patcher/patch/options/types/array/StringArrayPatchOption.kt +++ b/src/main/kotlin/app/revanced/patcher/patch/options/types/array/StringArrayPatchOption.kt @@ -11,6 +11,7 @@ import app.revanced.patcher.patch.options.PatchOption * @param title The title. * @param description A description. * @param required Whether the option is required. + * @param validate The function to validate values of the option. * * @see PatchOption */ @@ -20,8 +21,8 @@ class StringArrayPatchOption private constructor( title: String?, description: String?, required: Boolean, - validator: (Array?) -> Boolean -) : PatchOption>(key, default, title, description, required, validator) { + validate: (Array?) -> Boolean +) : PatchOption>(key, default, title, description, required, validate) { companion object { /** * Create a new [StringArrayPatchOption] and add it to the current [Patch]. @@ -31,6 +32,8 @@ class StringArrayPatchOption private constructor( * @param title The title. * @param description A description. * @param required Whether the option is required. + * @param validate The function to validate values of the option. + * * @return The created [StringArrayPatchOption]. * * @see StringArrayPatchOption @@ -42,7 +45,7 @@ class StringArrayPatchOption private constructor( title: String? = null, description: String? = null, required: Boolean = false, - validator: (Array?) -> Boolean = { true } - ) = StringArrayPatchOption(key, default, title, description, required, validator).also { options.register(it) } + validate: (Array?) -> Boolean = { true } + ) = StringArrayPatchOption(key, default, title, description, required, validate).also { options.register(it) } } }