Skip to content

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.

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.

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.

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.

NDefEncoder · NDefText · NDefMessage

NDefEncoder Javadoc · All API types