@Test public void testUserSpecifiedLayers() { byte[] alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".getBytes(StandardCharsets.ISO_8859_1); AztecCode aztec = Encoder.encode(alphabet, 25, -2); assertEquals(2, aztec.getLayers()); assertTrue(aztec.isCompact()); aztec = Encoder.encode(alphabet, 25, 32); assertEquals(32, aztec.getLayers()); assertFalse(aztec.isCompact()); try { Encoder.encode(alphabet, 25, 33); fail("Encode should have failed. No such thing as 33 layers"); } catch (IllegalArgumentException expected) { } try { Encoder.encode(alphabet, 25, -1); fail("Encode should have failed. Text can't fit in 1-layer compact"); } catch (IllegalArgumentException expected) { } }
public static AztecCode encode(byte[] data) { return encode(data, DEFAULT_EC_PERCENT, DEFAULT_AZTEC_LAYERS); }
Encoder { public static AztecCode encode(byte[] data) { return encode(data, DEFAULT_EC_PERCENT, DEFAULT_AZTEC_LAYERS); } }
Encoder { public static AztecCode encode(byte[] data) { return encode(data, DEFAULT_EC_PERCENT, DEFAULT_AZTEC_LAYERS); } private  Encoder(); }
Encoder { public static AztecCode encode(byte[] data) { return encode(data, DEFAULT_EC_PERCENT, DEFAULT_AZTEC_LAYERS); } private  Encoder(); static AztecCode encode(byte[] data); static AztecCode encode(byte[] data, int minECCPercent, int userSpecifiedLayers); }
Encoder { public static AztecCode encode(byte[] data) { return encode(data, DEFAULT_EC_PERCENT, DEFAULT_AZTEC_LAYERS); } private  Encoder(); static AztecCode encode(byte[] data); static AztecCode encode(byte[] data, int minECCPercent, int userSpecifiedLayers); static final int DEFAULT_EC_PERCENT; static final int DEFAULT_AZTEC_LAYERS; }