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

Package com.google.zxing

# Class Result

java.lang.Object
com.google.zxing.Result

public final class Result extends Object

Encapsulates the result of decoding a barcode within an image.

Author:
  Sean Owen

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Result(String text, byte[] rawBytes, int numBits, ResultPoint[] resultPoints, BarcodeFormat format, long timestamp)`
  `Result(String text, byte[] rawBytes, ResultPoint[] resultPoints, BarcodeFormat format)`
  `Result(String text, byte[] rawBytes, ResultPoint[] resultPoints, BarcodeFormat format, long timestamp)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addResultPoints(ResultPoint[] newPoints)`
  `BarcodeFormat`
  `getBarcodeFormat()`
  `int`
  `getNumBits()`
  `byte[]`
  `getRawBytes()`
  `Map<ResultMetadataType,Object>`
  `getResultMetadata()`
  `ResultPoint[]`
  `getResultPoints()`
  `String`
  `getText()`
  `long`
  `getTimestamp()`
  `void`
  `putAllMetadata(Map<ResultMetadataType,Object> metadata)`
  `void`
  `putMetadata(ResultMetadataType type, Object value)`
  `String`
  `toString()`

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

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

- ## Constructor Details

  - ### Result

    public Result(String text, byte[] rawBytes, ResultPoint[] resultPoints, BarcodeFormat format)

  - ### Result

    public Result(String text, byte[] rawBytes, ResultPoint[] resultPoints, BarcodeFormat format, long timestamp)

  - ### Result

    public Result(String text, byte[] rawBytes, int numBits, ResultPoint[] resultPoints, BarcodeFormat format, long timestamp)

- ## Method Details

  - ### getText

    public String getText()
    Returns:
      raw text encoded by the barcode

  - ### getRawBytes

    public byte[] getRawBytes()
    Returns:
      raw bytes encoded by the barcode, if applicable, otherwise `null`

  - ### getNumBits

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

  - ### getResultPoints

    public ResultPoint[] getResultPoints()
    Returns:
      points related to the barcode in the image. These are typically points identifying finder patterns or the corners of the barcode. The exact meaning is specific to the type of barcode that was decoded.

  - ### getBarcodeFormat

    public BarcodeFormat getBarcodeFormat()
    Returns:
      `BarcodeFormat` representing the format of the barcode that was decoded

  - ### getResultMetadata

    public Map<ResultMetadataType,Object> getResultMetadata()
    Returns:
      `Map` mapping `ResultMetadataType` keys to values. May be `null`. This contains optional metadata about what was detected about the barcode, like orientation.

  - ### putMetadata

    public void putMetadata(ResultMetadataType type, Object value)

  - ### putAllMetadata

    public void putAllMetadata(Map<ResultMetadataType,Object> metadata)

  - ### addResultPoints

    public void addResultPoints(ResultPoint[] newPoints)

  - ### getTimestamp

    public long getTimestamp()

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`