|
|
@ -52,8 +52,8 @@ public final class QrSegment {
|
|
|
|
* encoded in byte mode. All input byte arrays are acceptable.
|
|
|
|
* encoded in byte mode. All input byte arrays are acceptable.
|
|
|
|
* <p>Any text string can be converted to UTF-8 bytes ({@code
|
|
|
|
* <p>Any text string can be converted to UTF-8 bytes ({@code
|
|
|
|
* s.getBytes(StandardCharsets.UTF_8)}) and encoded as a byte mode segment.</p>
|
|
|
|
* s.getBytes(StandardCharsets.UTF_8)}) and encoded as a byte mode segment.</p>
|
|
|
|
* @param data the binary data
|
|
|
|
* @param data the binary data (not {@code null})
|
|
|
|
* @return a segment containing the data
|
|
|
|
* @return a segment (not {@code null}) containing the data
|
|
|
|
* @throws NullPointerException if the array is {@code null}
|
|
|
|
* @throws NullPointerException if the array is {@code null}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static QrSegment makeBytes(byte[] data) {
|
|
|
|
public static QrSegment makeBytes(byte[] data) {
|
|
|
@ -67,8 +67,8 @@ public final class QrSegment {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns a segment representing the specified string of decimal digits encoded in numeric mode.
|
|
|
|
* Returns a segment representing the specified string of decimal digits encoded in numeric mode.
|
|
|
|
* @param digits the text, with only digits from 0 to 9 allowed
|
|
|
|
* @param digits the text (not {@code null}), with only digits from 0 to 9 allowed
|
|
|
|
* @return a segment containing the text
|
|
|
|
* @return a segment (not {@code null}) containing the text
|
|
|
|
* @throws NullPointerException if the string is {@code null}
|
|
|
|
* @throws NullPointerException if the string is {@code null}
|
|
|
|
* @throws IllegalArgumentException if the string contains non-digit characters
|
|
|
|
* @throws IllegalArgumentException if the string contains non-digit characters
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -91,8 +91,8 @@ public final class QrSegment {
|
|
|
|
* Returns a segment representing the specified text string encoded in alphanumeric mode.
|
|
|
|
* Returns a segment representing the specified text string encoded in alphanumeric mode.
|
|
|
|
* The characters allowed are: 0 to 9, A to Z (uppercase only), space,
|
|
|
|
* The characters allowed are: 0 to 9, A to Z (uppercase only), space,
|
|
|
|
* dollar, percent, asterisk, plus, hyphen, period, slash, colon.
|
|
|
|
* dollar, percent, asterisk, plus, hyphen, period, slash, colon.
|
|
|
|
* @param text the text, with only certain characters allowed
|
|
|
|
* @param text the text (not {@code null}), with only certain characters allowed
|
|
|
|
* @return a segment containing the text
|
|
|
|
* @return a segment (not {@code null}) containing the text
|
|
|
|
* @throws NullPointerException if the string is {@code null}
|
|
|
|
* @throws NullPointerException if the string is {@code null}
|
|
|
|
* @throws IllegalArgumentException if the string contains non-encodable characters
|
|
|
|
* @throws IllegalArgumentException if the string contains non-encodable characters
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -118,7 +118,7 @@ public final class QrSegment {
|
|
|
|
* Returns a list of zero or more segments to represent the specified Unicode text string.
|
|
|
|
* Returns a list of zero or more segments to represent the specified Unicode text string.
|
|
|
|
* The result may use various segment modes and switch modes to optimize the length of the bit stream.
|
|
|
|
* The result may use various segment modes and switch modes to optimize the length of the bit stream.
|
|
|
|
* @param text the text to be encoded, which can be any Unicode string
|
|
|
|
* @param text the text to be encoded, which can be any Unicode string
|
|
|
|
* @return a new mutable list of segments containing the text
|
|
|
|
* @return a new mutable list (not {@code null}) of segments (not {@code null}) containing the text
|
|
|
|
* @throws NullPointerException if the text is {@code null}
|
|
|
|
* @throws NullPointerException if the text is {@code null}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static List<QrSegment> makeSegments(String text) {
|
|
|
|
public static List<QrSegment> makeSegments(String text) {
|
|
|
@ -141,7 +141,7 @@ public final class QrSegment {
|
|
|
|
* Returns a segment representing an Extended Channel Interpretation
|
|
|
|
* Returns a segment representing an Extended Channel Interpretation
|
|
|
|
* (ECI) designator with the specified assignment value.
|
|
|
|
* (ECI) designator with the specified assignment value.
|
|
|
|
* @param assignVal the ECI assignment number (see the AIM ECI specification)
|
|
|
|
* @param assignVal the ECI assignment number (see the AIM ECI specification)
|
|
|
|
* @return a segment containing the data
|
|
|
|
* @return a segment (not {@code null}) containing the data
|
|
|
|
* @throws IllegalArgumentException if the value is outside the range [0, 10<sup>6</sup>)
|
|
|
|
* @throws IllegalArgumentException if the value is outside the range [0, 10<sup>6</sup>)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static QrSegment makeEci(int assignVal) {
|
|
|
|
public static QrSegment makeEci(int assignVal) {
|
|
|
|