getOrDefault abstract method

String getOrDefault(
  1. String key,
  2. String defaultValue
)

Returns the value of the key if found, otherwise returns defaultValue.

This avoids needing to manually check for null.

Implementation

String getOrDefault(String key, String defaultValue);