switch (carrierTypeFormat) {
case WellKnown: {
// NFC Forum well-known type [NFC RTD]
Record record = messageDecoder.decodeToRecord(carrierType);
if (record instanceof WellKnownRecord) {
handoverCarrierRecord.setCarrierType(record);
}
else {
throw new IllegalArgumentException("Expected well-known type carrier type");
}
break;
}
case Media: {
// Media-type as defined in RFC 2046 [RFC 2046]
handoverCarrierRecord.setCarrierType(new String(carrierType, NdefConstants.DEFAULT_CHARSET));
break;
}
case AbsoluteURI: {
// Absolute URI as defined in RFC 3986 [RFC 3986]
handoverCarrierRecord.setCarrierType(new String(carrierType, NdefConstants.DEFAULT_CHARSET));
break;
}
case External: {
// NFC Forum external type [NFC RTD]
Record record = messageDecoder.decodeToRecord(carrierType);
if (record instanceof UnsupportedExternalTypeRecord) {
handoverCarrierRecord.setCarrierType(record);
}
else {