com.twitter.processing

trait JsonSugar

[source: com/twitter/processing/JsonSugar.scala]

trait JsonSugar
extends AnyRef
Methods to avoid the tedium of getting a value, checking to see if it's null, and then performing some function on it. Used like ss(jsonObj, "foo") { myObj.foo = _ } }
Direct Known Subclasses:
Status, User

Method Summary
def sb (json : com.google.gson.JsonObject, key : java.lang.String)(f : (Boolean) => Unit) : Unit
Apply a function to a Boolean value held in a JSON Object (if it's non-null)
def si (json : com.google.gson.JsonObject, key : java.lang.String)(f : (Int) => Unit) : Unit
Apply a function to an Int value held in a JSON Object (if it's non-null)
def sl (json : com.google.gson.JsonObject, key : java.lang.String)(f : (Long) => Unit) : Unit
Apply a function to a Long value held in a JSON Object (if it's non-null)
def ss (json : com.google.gson.JsonObject, key : java.lang.String)(f : (java.lang.String) => Unit) : Unit
Apply a function to a String value held in a JSON Object (if it's non-null)
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
def ss(json : com.google.gson.JsonObject, key : java.lang.String)(f : (java.lang.String) => Unit) : Unit
Apply a function to a String value held in a JSON Object (if it's non-null)

def sb(json : com.google.gson.JsonObject, key : java.lang.String)(f : (Boolean) => Unit) : Unit
Apply a function to a Boolean value held in a JSON Object (if it's non-null)

def sl(json : com.google.gson.JsonObject, key : java.lang.String)(f : (Long) => Unit) : Unit
Apply a function to a Long value held in a JSON Object (if it's non-null)

def si(json : com.google.gson.JsonObject, key : java.lang.String)(f : (Int) => Unit) : Unit
Apply a function to an Int value held in a JSON Object (if it's non-null)


processing library Tweet Stream by Mark McBride. (c) 2009