public static JcfResult <string> GetString(this Jcf source, string key) { try { return((source[key] is string str) ? (JcfResult <string>)str : (JcfResult <string>)ResultOptions.TypeWrong); } catch (ArgumentException ae) { return((JcfResult <string>)ae); } }
public static JcfResult <List <Jcf> > GetList(this Jcf source, string key) { try { return((source[key] is List <Jcf> jcf) ? (JcfResult <List <Jcf> >)jcf : (JcfResult <List <Jcf> >)ResultOptions.TypeWrong); } catch (ArgumentException ae) { return((JcfResult <List <Jcf> >)ae); } }
public static JcfResult <JcfEnumerable> GetMappedList(this Jcf source, string key, string innerkey) { JcfResult <List <Jcf> > lst = source.GetList(key); if (lst) { return((JcfResult <JcfEnumerable>)(new JcfEnumerable(lst.value, innerkey))); } else { return(lst.CrossCast <JcfEnumerable>()); } }