NDefEncoder.EncodedValue
com.rvi.application.NDefEncoder.EncodedValue · Private record · SocialCard 1.0.3
Hold the record type and payload before the encoder writes the NDEF bytes.
When to use it
Section titled “When to use it”Use NDefEncoder.encode() or NDefMessageCreator.build() from application code. The example round-trips a text record through the public methods so you can see how the internal data becomes an NDEF record.
Java example
Section titled “Java example”final NDefMessage message = new NDefEncoder().encode( List.of(new NDefText("Hello", "en")));
System.out.println(new NDefDecoder().decode(message));Java imports
import com.rvi.application.NDefDecoder;import com.rvi.application.NDefEncoder;import com.rvi.domain.NDefMessage;import com.rvi.domain.NDefText;import java.util.List;The nested record is private. The stable result for callers is the NDefMessage returned by the encoder.
How it works
Section titled “How it works”EncodedValue groups typeNameFormat, type and payload. For a text value the encoder creates a well-known record type T with the text status byte, language and UTF-8 body. The surrounding encoder adds message boundary flags and length fields.