Package com.iizix.barcode
Class BarcodeData
java.lang.Object
com.iizix.barcode.BarcodeData
Class containing the barcode that has been read from an image.
- Author:
- Christopher Mindus
Method Summary
Modifier and TypeMethodDescriptionasURN()
Gets the URN representation of this barcode if it is encodable.asURN
(int width, int height) Gets the URN representation of this barcode if it is encodable, in the requested size.Creates a barcode builder with the barcode type and text.boolean
Checks if this barcode data is equal to another object.Gets the string representation of the barcode format.getText()
Gets the barcode text.long
Gets the timestamp when the barcode was decoded.getType()
Gets the IIZI barcode type if it is encodable.Gets the barcode Zxing format enum.int
hashCode()
Returns the hashcode of the barcode data.toString()
Gets a String representation of the barcode data.
Method Details
getText
Gets the barcode text.- Returns:
- The text.
getType
Gets the IIZI barcode type if it is encodable.- Returns:
- The barcode type, or
null
if it cannot be re-encoded.
asURN
Gets the URN representation of this barcode if it is encodable.Please note that you need to assign a size to the barcode to encoded it.
Use the
BarcodeURN.createBuilder()
to do so, or use the methodasURN(int, int)
.- Returns:
- The barcode URN without size (smallest size possible), or
null
if it cannot be encoded. - Throws:
BarcodeException
- If the text cannot be encoded in the barcode type or format.
asURN
Gets the URN representation of this barcode if it is encodable, in the requested size.Use the
BarcodeURN.createBuilder()
if you wish to add more parameters for encoding and place that information in a BarcodeURN.Note that the values can be enlarged if the barcode bitmap does not fit inside the requested dimension.
- Parameters:
width
- The width.height
- The height.- Returns:
- The barcode with the specified size, or
null
if it cannot be encoded. - Throws:
IllegalArgumentException
- If thesize
is negative.BarcodeException
createBuilder
Creates a barcode builder with the barcode type and text.The builder is in non-validating mode, if one is created.
- Returns:
- The barcode builder initialized with the type and text, or
null
if the barcode is not encodable.
getFormatString
Gets the string representation of the barcode format.- Returns:
- A string of the barcode format.
getZxingFormat
Gets the barcode Zxing format enum.- Returns:
- The Zxing barcode format.
getTimeStamp
public long getTimeStamp()Gets the timestamp when the barcode was decoded.- Returns:
- A timestamp in milliseconds since the Epoch.
hashCode
public int hashCode()Returns the hashcode of the barcode data.equals
Checks if this barcode data is equal to another object.toString
Gets a String representation of the barcode data.