/** * Returns a Integer value by the name * @param name * @return int? */ public int?getInt(String name) { TJSONPair p = get(name); if (p == null) { return(null); } return(Convert.ToInt32(((TJSONNumber)p.value).getValue())); }
/** * Returns a Double value by the name * @param name * @return double? */ public Double?getDouble(String name) { TJSONPair p = get(name); if (p == null) { return(null); } return(Convert.ToDouble(((TJSONNumber)p.value).getValue())); }
/** * Returns a Boolean value by the name * @param name * @return boolean? */ public Boolean?getBoolean(String name) { TJSONPair p = get(name); if (p == null) { return(null); } if (p.value is TJSONTrue) { return(true); } else { return(false); } }
/** * Adds {@link TJSONPair} * @param pair * @return TJSONObject */ public TJSONObject addPairs(TJSONPair pair) { Elements.Add(pair); return this; }
/** * Class constructor, create the internal list and add the passed * {@link TJSONPair} * * @param pair */ public TJSONObject(TJSONPair pair) : base() { Elements = new List<TJSONPair>(); addPairs(pair); }
/** * Adds {@link TJSONPair} * @param pair * @return TJSONObject */ public TJSONObject addPairs(TJSONPair pair) { Elements.Add(pair); return(this); }
/** * Class constructor, create the internal list and add the passed * {@link TJSONPair} * * @param pair */ public TJSONObject(TJSONPair pair) : base() { Elements = new List <TJSONPair>(); addPairs(pair); }