GS1Code

class GS1Code(val code: String)

Class for parsing GS1 codes

Constructors

Link copied to clipboard
constructor(code: String)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Price(val price: BigDecimal, val currencyCode: String?)

Class representing a parsed price in a gs1 code

Properties

Link copied to clipboard
val amount: Int?

Get the amount if contained in the gs1 code

Link copied to clipboard
val area: Int?

Get the area if contained in the gs1 code, converted to square centimeters.

Link copied to clipboard
Link copied to clipboard

Contains all elements found in the GS1 code

Link copied to clipboard
val gtin: String?

Get the GTIN that is contained in the GS1 code for identifying the product.

Link copied to clipboard
val length: Int?

Get the length if contained in the gs1 code, converted to millimeters.

Link copied to clipboard
val liters: Int?

Get the liters if contained in the gs1 code, converted to milliliters.

Link copied to clipboard

Get the price if contained in the gs1 code

Link copied to clipboard

Contains all unknown elements, not recognized by the parser

Link copied to clipboard
val volume: Int?

Get the volume if contained in the gs1 code, converted to cubic centimeters.

Link copied to clipboard
val weight: Int?

Get the weight if contained in the gs1 code, converted to grams.

Functions

Link copied to clipboard
fun getArea(unit: Unit): BigDecimal?

Get the area if contained in the gs1 code, converted to Unit.

Link copied to clipboard
fun getEmbeddedData(encodingUnit: Unit?, digits: Int?, roundingMode: RoundingMode?): BigDecimal?

Get the encoded data from gs1 code, if contained.

Link copied to clipboard

Get the length if contained in the gs1 code, converted to Unit.

Link copied to clipboard

Get the liters if contained in the gs1 code, converted to Unit.

Link copied to clipboard
fun getPrice(digits: Int, roundingMode: RoundingMode): GS1Code.Price?

Get the price if contained in the gs1 code, rounding to a set number of digits

Link copied to clipboard

Get the volume if contained in the gs1 code, converted to Unit.

Link copied to clipboard

Get the weight if contained in the gs1 code, converted to Unit.