Interface IBarcodescanner

    • Field Detail

      • DEFAULT

        static final IBarcodescanner DEFAULT
        Constant for default attributes of this immutable component.
    • Method Detail

      • getWidgetClass

        default java.lang.String getWidgetClass()
        Returns the client widget class.

        Default: "zkmax.barscanner.Barcodescanner"

        Specified by:
        getWidgetClass in interface IComponent<IBarcodescanner>
      • getConstraints

        @Nullable
        java.util.Map<java.lang.String,​java.lang.Object> getConstraints()
        Returns the constraints. About allowed constraints setting, see MediaStreamConstraints

        Default: null.

      • withConstraints

        IBarcodescanner withConstraints​(@Nullable
                                        java.util.Map<java.lang.String,​? extends java.lang.Object> constraints)
        Returns a copy of this immutable component with the specified constraints.

        Sets the constraints. About allowed constraints setting, see MediaStreamConstraints

        Parameters:
        constraints - The constraints setting.

        Default: null.

        Returns:
        A modified copy of the this object
      • getType

        default java.lang.String getType()
        Returns the types which the barcode scanner is dealing with.

        Default: "CODE128".

      • withType

        IBarcodescanner withType​(java.lang.String type)
        Returns a copy of this immutable component with the specified type.

        Sets the encoded and decoded type of this component. The built-in types are

        • CODE family: CODE39, CODE128, CODE128A, CODE128B, CODE128C
        • EAN family: EAN13, EAN8, EAN5, EAN2
        • ITF family: ITF14, ITF
        • MSI family: MSI, MSI10, MSI11, MSI1010, MSI1110
        • others: UPC, PHARMACODE , CODABAR, QR
        Some types have character and length limit. You can check it at https://en.wikipedia.org/wiki/Barcode
        Parameters:
        type - The encoded and decoded type of this component.

        Default: "CODE128".

        Returns:
        A modified copy of the this object
      • getInterval

        default double getInterval()
        Returns the scan interval of the barcode scanner.

        Default: 1000. Unit: millisecond.

      • withInterval

        IBarcodescanner withInterval​(double interval)
        Returns a copy of this immutable component with the specified interval.

        Sets the scan interval of the barcode scanner.

        Parameters:
        interval - The scan interval of the barcode scanner.

        Default: 1000. Unit: millisecond.

        Returns:
        A modified copy of the this object
      • getConsistencyBufferSize

        default int getConsistencyBufferSize()
        Returns the consistency buffer size (used in 1D barcode).

        Default: 5.

      • withConsistencyBufferSize

        IBarcodescanner withConsistencyBufferSize​(int consistencyBufferSize)
        Returns a copy of this immutable component with the specified consistencyBufferSize.

        Sets the consistency buffer size (used in 1D barcode).

        Parameters:
        consistencyBufferSize - The consistency buffer size (used in 1D barcode).

        Default: 5.

        Returns:
        A modified copy of the this object
      • getConsistencyThreshold

        default int getConsistencyThreshold()
        Returns the consistency threshold (used in 1D barcode). In other way, the result is required to be scanned at least N times out of consistency buffer size.

        Default: 3.

      • withConsistencyThreshold

        IBarcodescanner withConsistencyThreshold​(int consistencyThreshold)
        Returns a copy of this immutable component with the specified consistencyThreshold.

        Sets the consistency threshold (used in 1D barcode).

        Parameters:
        consistencyThreshold - The consistency threshold (used in 1D barcode).

        Default: 3.

        Returns:
        A modified copy of the this object
      • getErrorAcceptance

        default double getErrorAcceptance()
        Returns the error acceptance (used in 1D barcode).

        Default: 0.1 (means 10%)

      • withErrorAcceptance

        IBarcodescanner withErrorAcceptance​(double errorAcceptance)
        Returns a copy of this immutable component with the specified errorAcceptance.

        Sets the error acceptance (used in 1D barcode).

        Parameters:
        errorAcceptance - The error acceptance (used in 1D barcode).

        Default: 0.1 (means 10%).

        Returns:
        A modified copy of the this object
      • isContinuous

        default boolean isContinuous()
        Returns the continuous scan status of the barcode scanner.

        Default: false.

        Returns:
        boolean
      • withContinuous

        IBarcodescanner withContinuous​(boolean continuous)
        Returns a copy of this immutable component with the specified continuous.

        Sets the continuous scan status of the barcode scanner.

        Parameters:
        continuous - The continuous scan status of the barcode scanner.

        Default: false.

        Returns:
        A modified copy of the this object
      • isEnable

        default boolean isEnable()
        Returns the enabled status of the barcode scanner.

        Default: true.

      • withEnable

        IBarcodescanner withEnable​(boolean enable)
        Returns a copy of this immutable component with the specified enable.

        Sets the enabled status of the barcode scanner.

        Parameters:
        enable - The enabled status of the barcode scanner.

        Default: true.

        Returns:
        A modified copy of the this object
      • ofType

        static IBarcodescanner ofType​(java.lang.String type)
        Returns the instance with the given type
        Parameters:
        type - The encoded or decoded type of the component.
      • ofInterval

        static IBarcodescanner ofInterval​(int interval)
        Returns the instance with the given interval

        By calling this, isContinuous() to be true.

        Parameters:
        interval - The scan interval of the barcode scanner.
      • ofId

        static IBarcodescanner ofId​(java.lang.String id)
        Returns the instance with the given id.
        Parameters:
        id - The id to identify this component