Class DecoderResult


  • public final class DecoderResult
    extends java.lang.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.

    • Field Detail

      • rawBytes

        private final byte[] rawBytes
      • numBits

        private int numBits
      • text

        private final java.lang.String text
      • byteSegments

        private final java.util.List<byte[]> byteSegments
      • ecLevel

        private final java.lang.String ecLevel
      • errorsCorrected

        private java.lang.Integer errorsCorrected
      • erasures

        private java.lang.Integer erasures
      • other

        private java.lang.Object other
      • structuredAppendParity

        private final int structuredAppendParity
      • structuredAppendSequenceNumber

        private final int structuredAppendSequenceNumber
      • symbologyModifier

        private final int symbologyModifier
    • Constructor Detail

      • DecoderResult

        public DecoderResult​(byte[] rawBytes,
                             java.lang.String text,
                             java.util.List<byte[]> byteSegments,
                             java.lang.String ecLevel)
      • DecoderResult

        public DecoderResult​(byte[] rawBytes,
                             java.lang.String text,
                             java.util.List<byte[]> byteSegments,
                             java.lang.String ecLevel,
                             int symbologyModifier)
      • DecoderResult

        public DecoderResult​(byte[] rawBytes,
                             java.lang.String text,
                             java.util.List<byte[]> byteSegments,
                             java.lang.String ecLevel,
                             int saSequence,
                             int saParity)
      • DecoderResult

        public DecoderResult​(byte[] rawBytes,
                             java.lang.String text,
                             java.util.List<byte[]> byteSegments,
                             java.lang.String ecLevel,
                             int saSequence,
                             int saParity,
                             int symbologyModifier)
    • Method Detail

      • 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 java.lang.String getText()
        Returns:
        text representation of the result
      • getByteSegments

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

        public java.lang.String getECLevel()
        Returns:
        name of error correction level used, or null if not applicable
      • getErrorsCorrected

        public java.lang.Integer getErrorsCorrected()
        Returns:
        number of errors corrected, or null if not applicable
      • setErrorsCorrected

        public void setErrorsCorrected​(java.lang.Integer errorsCorrected)
      • getErasures

        public java.lang.Integer getErasures()
        Returns:
        number of erasures corrected, or null if not applicable
      • setErasures

        public void setErasures​(java.lang.Integer erasures)
      • getOther

        public java.lang.Object getOther()
        Returns:
        arbitrary additional metadata
      • setOther

        public void setOther​(java.lang.Object other)
      • hasStructuredAppend

        public boolean hasStructuredAppend()
      • getStructuredAppendParity

        public int getStructuredAppendParity()
      • getStructuredAppendSequenceNumber

        public int getStructuredAppendSequenceNumber()
      • getSymbologyModifier

        public int getSymbologyModifier()