Closed sajjadmohammadi closed 6 years ago
@sajjadmohammadi From 'repeats the code' perspective, default value is not necessary. It can be solved by logic.
if(Hawk.contains(key) && Hawk.get(key).equals("myValue")) {
// commands_one
} else {
// commands_two
}
Hawk
has an overloaded get
method which accepts default value.
Hawk.get(key, defaultValue)
. Does this help?
Closing this issue for now, we can definitely re-open if needed
Hi guys. how can set default value like sharedPreferences? if Hawk does not have this feature, can cause Repeats the code. For example, block the commands "commands_one" and "commands_two": "commands_two" is repeat in following code
if(Hawk.contains(key)){ if(Hawk.get(key).equals("myValue")){ //commands_one }else{ //commands_two } }else{ //commands_two }