final byte[] familyBytes = familyID.toByteArray();
if (qualifierName == null) {
// Unqualified column
return new CassandraColumnName(familyBytes, null);
} else if (family.isGroupType()) {
// Group type family.
final ColumnId qualifierID = family.getColumnIdNameMap().inverse().get(qualifierName);
final byte[] qualifierBytes = qualifierID.toByteArray();
return new CassandraColumnName(familyBytes, qualifierBytes);
} else {
// Map type family.
assert family.isMapType();
final byte[] qualifierBytes = Bytes.toBytes(qualifierName);
return new CassandraColumnName(familyBytes, qualifierBytes);
}
}