DecoderResult (ZXing 3.5.2 API)
Description: declaration: package: com.google.zxing.common, class: DecoderResult

Package com.google.zxing.common

# Class DecoderResult

java.lang.Object
com.google.zxing.common.DecoderResult

public final class DecoderResult extends Object

Encapsulates the result of decoding a matrix of bits. This typically applies to 2D barcode formats. For now it contains the raw bytes obtained, as well as a String interpretation of those bytes, if applicable.

Author:
  Sean Owen

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DecoderResult(byte[] rawBytes, String text, List<byte[]> byteSegments, String ecLevel)`
  `DecoderResult(byte[] rawBytes, String text, List<byte[]> byteSegments, String ecLevel, int symbologyModifier)`
  `DecoderResult(byte[] rawBytes, String text, List<byte[]> byteSegments, String ecLevel, int saSequence, int saParity)`
  `DecoderResult(byte[] rawBytes, String text, List<byte[]> byteSegments, String ecLevel, int saSequence, int saParity, int symbologyModifier)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `List<byte[]>`
  `getByteSegments()`
  `String`
  `getECLevel()`
  `Integer`
  `getErasures()`
  `Integer`
  `getErrorsCorrected()`
  `int`
  `getNumBits()`
  `Object`
  `getOther()`
  `byte[]`
  `getRawBytes()`
  `int`
  `getStructuredAppendParity()`
  `int`
  `getStructuredAppendSequenceNumber()`
  `int`
  `getSymbologyModifier()`
  `String`
  `getText()`
  `boolean`
  `hasStructuredAppend()`
  `void`
  `setErasures(Integer erasures)`
  `void`
  `setErrorsCorrected(Integer errorsCorrected)`
  `void`
  `setNumBits(int numBits)`
  `void`
  `setOther(Object other)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### DecoderResult

    public DecoderResult(byte[] rawBytes, String text, List<byte[]> byteSegments, String ecLevel)

  - ### DecoderResult

    public DecoderResult(byte[] rawBytes, String text, List<byte[]> byteSegments, String ecLevel, int symbologyModifier)

  - ### DecoderResult

    public DecoderResult(byte[] rawBytes, String text, List<byte[]> byteSegments, String ecLevel, int saSequence, int saParity)

  - ### DecoderResult

    public DecoderResult(byte[] rawBytes, String text, List<byte[]> byteSegments, String ecLevel, int saSequence, int saParity, int symbologyModifier)

- ## Method Details

  - ### getRawBytes

    public byte[] getRawBytes()
    Returns:
      raw bytes representing the result, or `null` if not applicable

  - ### getNumBits

    public int getNumBits()
    Returns:
      how many bits of `getRawBytes()` are valid; typically 8 times its length
    Since:
      3.3.0

  - ### setNumBits

    public void setNumBits(int numBits)
    Parameters:
      `numBits` - overrides the number of bits that are valid in `getRawBytes()`
    Since:
      3.3.0

  - ### getText

    public String getText()
    Returns:
      text representation of the result

  - ### getByteSegments

    public List<byte[]> getByteSegments()
    Returns:
      list of byte segments in the result, or `null` if not applicable

  - ### getECLevel

    public String getECLevel()
    Returns:
      name of error correction level used, or `null` if not applicable

  - ### getErrorsCorrected

    public Integer getErrorsCorrected()
    Returns:
      number of errors corrected, or `null` if not applicable

  - ### setErrorsCorrected

    public void setErrorsCorrected(Integer errorsCorrected)

  - ### getErasures

    public Integer getErasures()
    Returns:
      number of erasures corrected, or `null` if not applicable

  - ### setErasures

    public void setErasures(Integer erasures)

  - ### getOther

    public Object getOther()
    Returns:
      arbitrary additional metadata

  - ### setOther

    public void setOther(Object other)

  - ### hasStructuredAppend

    public boolean hasStructuredAppend()

  - ### getStructuredAppendParity

    public int getStructuredAppendParity()

  - ### getStructuredAppendSequenceNumber

    public int getStructuredAppendSequenceNumber()

  - ### getSymbologyModifier

    public int getSymbologyModifier()