cast<V extends JsonValue> method

Map<JsonString, V> cast<V extends JsonValue>()
override

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>();
}