internal FdbSystemStatus(Dictionary <string, object> doc, long readVersion, string raw) : base(doc) { m_client = new ClientStatus(TinyJsonParser.GetMapField(doc, "client")); m_cluster = new ClusterStatus(TinyJsonParser.GetMapField(doc, "cluster")); m_readVersion = readVersion; m_raw = raw; }
internal FdbSystemStatus(Dictionary <string, object?>?doc, long readVersion, Slice raw) : base(doc) { this.Client = new ClientStatus(TinyJsonParser.GetMapField(doc, "client")); this.Cluster = new ClusterStatus(TinyJsonParser.GetMapField(doc, "cluster")); this.ReadVersion = readVersion; this.RawData = raw; }
internal static LoadCounter From(Dictionary <string, object> data, string field) { var obj = TinyJsonParser.GetMapField(data, field); return(new LoadCounter( (long)(TinyJsonParser.GetNumberField(obj, "counter") ?? 0), TinyJsonParser.GetNumberField(obj, "hz") ?? 0, TinyJsonParser.GetNumberField(obj, "roughness") ?? 0 )); }
internal static Message From(Dictionary <string, object?>?data, string field) { (var key, var value) = TinyJsonParser.GetStringPair(TinyJsonParser.GetMapField(data, field), "name", "description"); return(new Message(key ?? string.Empty, value ?? string.Empty)); }
protected bool?GetBoolean(string field1, string field2) { return(TinyJsonParser.GetBooleanField(TinyJsonParser.GetMapField(m_data, field1), field2)); }
protected double?GetDouble(string field1, string field2) { return(TinyJsonParser.GetNumberField(TinyJsonParser.GetMapField(m_data, field1), field2)); }
protected long?GetInt64(string field1, string field2) { var x = TinyJsonParser.GetNumberField(TinyJsonParser.GetMapField(m_data, field1), field2); return(x.HasValue ? (long?)x.Value : null); }
protected string?GetString(string field1, string field2) { return(TinyJsonParser.GetStringField(TinyJsonParser.GetMapField(m_data, field1), field2)); }
protected Dictionary <string, object?>?GetMap(string field) { return(TinyJsonParser.GetMapField(m_data, field)); }
internal static Message From(Dictionary <string, object> data, string field) { var kvp = TinyJsonParser.GetStringPair(TinyJsonParser.GetMapField(data, field), "name", "description"); return(new Message(kvp.Key ?? String.Empty, kvp.Value ?? String.Empty)); }