question: static String validateTnf ( short tnf , byte [ ] type , byte [ ] id , byte [ ] payload ) { switch ( tnf ) { case TNF_EMPTY : if ( type . length != 0 || id . length != 0 || payload . length != 0 ) { return "unexpected data in TNF_EMPTY record" ; } return null ; case TNF_WELL_KNOWN : case TNF_MIME_MEDIA : case TNF_ABSOLUTE_URI : case TNF_EXTERNAL_TYPE : return null ; case TNF_UNKNOWN : case TNF_RESERVED : if ( type . length != 0 ) { return "unexpected type field in TNF_UNKNOWN or TNF_RESERVEd record" ; } return null ; case TNF_UNCHANGED : return "unexpected TNF_UNCHANGED in first chunk or logical record" ; default : return String . format ( "unexpected tnf value: 0x%02x" , tnf ) ; } }
target:  Perform simple validation that the tnf is valid.<p> Validates the requirements of NFCForum-TS-NDEF_1.0 section 3.2.6 (Type Name Format). This just validates that the tnf is valid, and that the relevant type, id and payload fields are present (or empty) for this tnf. It does not perform any deep inspection of the type, id and payload fields.<p> Also does not allow TNF_UNCHANGED since this class is only used to present logical (unchunked) records.