Yup, this would be better as a type param or using the duck typing the object 

    switch(object.type) { case Balanced.FundingInstrument.CARD: /* use as a card */; }

or 

    if (object.has_some_property) { /* use that property */ }