Skip to main content

StringType

A string value paired with an OCR confidence score. Used throughout the SDK wherever the parsed value has associated extraction confidence.

Package: com.microblink.core

Declaration

class StringType : Parcelable

Constructors:

StringType(value: String?) // confidence = DEFAULT_CONFIDENCE (100)
StringType(value: String?, confidence: Float)

Quick Reference​

Constants​

ConstantDescription
DEFAULT_CONFIDENCEConfidence used when none is given (100f)
EMPTYShared instance with a null value

Properties​

PropertyDescription
value()The parsed string value
confidence()OCR or parsing confidence score
has()Whether the value is non-null and non-empty

Constants​

DEFAULT_CONFIDENCE​

const val DEFAULT_CONFIDENCE: Float = 100f

Confidence assigned by the one-argument constructor.


EMPTY​

val EMPTY: StringType

Shared StringType with a null value and DEFAULT_CONFIDENCE.


Properties​

value()​

fun value(): String?

The parsed string value.


confidence()​

fun confidence(): Float

OCR or parsing confidence score. DEFAULT_CONFIDENCE (100f) when created with the one-argument constructor.


has()​

fun has(): Boolean

true if value() is non-null and non-empty.