English: The when function of the Kotlin version of the method switch.
As long as the first true is found in Map.keys of conditionMap, its corresponding ValueGetter method will be executed immediately and the relative value will be returned.
If it is not found, it will return null; if you need a default value, you can add a MapEntry with a key equal to true at the end of the Map
English: Used to replace the switch method, because some scenes use switch to cause an error warning of Case expressions must be constant.
If there is value in Tuple2.item1 of conditionList, execute its corresponding ValueGetter method
English: Used to replace the switch method, because some scenes use switch to cause an error warning of Case expressions must be constant.
If there is value in Tuple2.item1 of conditionList, execute its corresponding ValueGetter method
English: Used to replace the switch method, because in some scenarios, an error warning of Case expressions must be constant;
If there is value in Map.keys of conditionMap, execute its corresponding ValueGetter method
English: Used to replace the switch method, because in some scenarios, an error warning of Case expressions must be constant;
If there is value in Map.keys of conditionMap, execute its corresponding ValueGetter method
English: Used to replace the switch method, because in some scenarios, an error warning of Case expressions must be constant;
If there is value in Map.keys of conditionMap, execute its corresponding ValueGetter method
English: Used to replace the switch method, because in some scenarios, an error warning of Case expressions must be constant;
If there is value in Map.keys of conditionMap, execute its corresponding ValueGetter method
English: The when function of the Kotlin version of the method switch.
As long as the first true is found in Map.keys of conditionMap, its corresponding ValueGetter method will be executed immediately and the relative value will be returned.
If it is not found, you must set defaultValue, or use the when method
English: Used to replace the switch method, because in some scenarios, an error warning of Case expressions must be constant;
If there is value in Map.keys of conditionMap, execute its corresponding ValueGetter method
English: Used to replace the switch method, because in some scenarios, an error warning of Case expressions must be constant;
If there is value in Map.keys of conditionMap, execute its corresponding ValueGetter method
English: The when function of the Kotlin version of the method switch,its conditional expression will be calculated。.
As long as conditionMap to Map.keys appears first execution result is true, it will immediately perform corresponding ValueGetter method, and an opposite return value.
If it is not found, it will return null; if you need a default value, you can add a MapEntry with a key equal to true at the end of the Map
English: The when function of the Kotlin version of the method switch,its conditional expression will be calculated。.
As long as conditionMap to Map.keys appears first execution result is true, it will immediately perform corresponding ValueGetter method, and an opposite return value.
If it is not found, it will return null; if you need a default value, you can add a MapEntry with a key equal to true at the end of the Map
English: The super evolution version💖💖💖 of switch method, all basic types of values can be compared, including List, Map, Set, and Iterable.
All need do is value in Map.keys of conditionMap, its corresponding ValueGetter method will be executed
English: The super evolution version💖💖💖 of switch method, all basic types of values can be compared, including List, Map, Set, and Iterable.
All need do is value in Map.keys of conditionMap, its corresponding ValueGetter method will be executed