Can we extract the 

if (!TextUtils.isEmpty( YYY )) {
      cardMap.put(XXX, YYY);
}

into a method, to remove duplication and to avoid calling the getter twice in every case?