@Override
public WellKnownRecord decodeRecord(NdefRecord ndefRecord, NdefMessageDecoder messageDecoder) {
WellKnownRecordConfig config = recordDecoders.get(new RecordType(ndefRecord.getType()));
if (config != null) {
WellKnownRecordPayloadDecoder payloadDecoder = config.getPayloadDecoder();
WellKnownRecord record = payloadDecoder.decodePayload(ndefRecord.getPayload(), messageDecoder);
record.setId(ndefRecord.getId());
return record;
}
else
throw new IllegalArgumentException("Unsupported Well Known NDEF Type [" + new String(ndefRecord.getType())
+ "]");