getInt


Description:

public static int getInt (JsonValue root, string path, int fallback = 0)

Returns an integer value at the given path with a fallback.

Example:

    int count = Json.getInt (root, "$.count", 0);

Parameters:

root

root value.

path

JSON path expression.

fallback

value to return if path not found or type mismatch.

Returns:

integer value or fallback.