cast<V extends JsonValue> method
Returns the object casting all values to the given type V
.
This method is useful when you know the type of the values, and want to avoid the overhead of checking the type and casting them manually. For example:
final object = JsonObject({'key': JsonString('value')}).cast<JsonString>();
Implementation
Map<JsonString, V> cast<V extends JsonValue>() {
return fields.cast<JsonString, V>();
}