Remove a variable of a class from another part of the code

123
May 05, 2022, at 2:40 PM

I have a class that I pass as a parameter to a function. This class contains various companion objects.

The class:

class GeneralConfiguration {
lateinit var planets: MutableMap<String, String>
lateinit var stars: MutableMap<String, String>
lateinit var comets: MutableMap<String, String>
class newConfiguration {
    companion object {
        const val SIZE = "general_size"
        const val TEXTURE = "general_texture"
        const val WEIGHT = "general_weight"
        const val COLOR = "general_color"
        const val GRAVITY = "general_gravity"
    
    }
}
}

To do a test, I need to pass that class as a parameter to the function, but having previously eliminated one of the variables, for example: "COLOR"

My intention is to make a test that is missing the variable "COLOR"

This is just an example, something like:

GeneralConfiguration.Remove(newConfiguration.COLOR)
myFoo(Param1, Param2, GeneralConfiguration) //Class with the variable already removed

Is it possible to remove one of those variables programmatically before passing the class as a parameter?

Thanks in advance

Rent Charter Buses Company
READ ALSO
Detect selected file type in onActivityResult

Detect selected file type in onActivityResult

I'trying to open camera with video and photoThis code working correctly but in onActivityResult can't check file type

108
How do ensure the flutter app is working on all android devices out there?

How do ensure the flutter app is working on all android devices out there?

We have a flutter app on iOS and android and we test on 2 or 3 android devices before every release and it works fine without any issueBut when I see in the review, people are giving 1 star says that the app is not working for them

96
Missing programFiles/java when trying to publish rn app

Missing programFiles/java when trying to publish rn app

okay, when i wanna publish my reactNative app and see the docs i'm stuck on the first step

96
I am getting this issue, I tried using kotlin coroutines and Async still getting the same Calling this from Your main thread can lead to deadlock,

I am getting this issue, I tried using kotlin coroutines and Async still getting the same Calling this from Your main thread can lead to deadlock,

I also made another class that implements runnable to make a new thread still it's now working, Also tried with AynctaskAt last, I made a view model but still same issue

111