CS340Group/hit — pull request #13 by murphyrandle (2012-09-23 03:56:52+00:00)
Title: Murphy

Now new barcodes are created like this:

Barcode foo = Barcode.newFromId("123");

Instead of like this:

Barcode foo = new Barcode(123);

Barcodes work with strings rather than ints. When I tried to feed in an 11-digit int I got an overflow error. So if you're making a barcode from an ID, convert it to a String first.

Alternatively, Barcodes can be made like this:

Barcode foo = new Barcode();
foo.setCode("124153241"); // <-- Must be a valid barcode, or your validation will fail! This is for entering an actual barcode that exists in the real world.
// Or you can do it this way if you're making a barcode from a product:
foo.makeAndSetCodeFromId("123");