feat!: Add PatchOption#toString

This commit is contained in:
oSumAtrIX 2023-10-22 01:59:51 +02:00
parent 09cd6aa568
commit c6095bc38a
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
2 changed files with 3 additions and 0 deletions

View File

@ -374,6 +374,7 @@ public class app/revanced/patcher/patch/options/PatchOption {
public fun reset ()V public fun reset ()V
public final fun setValue (Ljava/lang/Object;)V public final fun setValue (Ljava/lang/Object;)V
public final fun setValue (Ljava/lang/Object;Lkotlin/reflect/KProperty;Ljava/lang/Object;)V public final fun setValue (Ljava/lang/Object;Lkotlin/reflect/KProperty;Ljava/lang/Object;)V
public fun toString ()Ljava/lang/String;
} }
public final class app/revanced/patcher/patch/options/PatchOption$PatchExtensions { public final class app/revanced/patcher/patch/options/PatchOption$PatchExtensions {

View File

@ -75,6 +75,8 @@ open class PatchOption<T>(
if (!validator(value)) throw PatchOptionException.ValueValidationException(value, this) if (!validator(value)) throw PatchOptionException.ValueValidationException(value, this)
} }
override fun toString() = value.toString()
operator fun getValue(thisRef: Any?, property: KProperty<*>) = value operator fun getValue(thisRef: Any?, property: KProperty<*>) = value
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: T?) { operator fun setValue(thisRef: Any?, property: KProperty<*>, value: T?) {