All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kh.gov.nbc.bakong_khqr.utils.StringUtils Maven / Gradle / Ivy

Go to download

The standardization of KHQR code specifications will help promote wider use of mobile retail payments in Cambodia and provide consistent user experience for merchants and consumers. It can enable interoperability in the payment industry. A common QR code would facilitate payments among different schemes, e-wallets and banks and would encourage small merchants to adopt KHQR code as payment method. KHQR is created for retail or remittance in Cambodia and Cross-Border. It only requires a single QR for receiving transactions from any payment provider through Bakong including Bakong App.

The newest version!
package kh.gov.nbc.bakong_khqr.utils;


import java.lang.reflect.Array;

public class StringUtils {

    public static final String EMPTY = "";

    public static boolean isBlank(CharSequence cs) {
        int strLen = length(cs);
        if (strLen == 0) {
            return true;
        } else {
            for(int i = 0; i < strLen; ++i) {
                if (!Character.isWhitespace(cs.charAt(i))) {
                    return false;
                }
            }

            return true;
        }
    }

    public static int length(CharSequence cs) {
        return cs == null ? 0 : cs.length();
    }

    public static boolean isNoneBlank(CharSequence... css) {
        return !isAnyBlank(css);
    }
    private static int getLength(Object array) {
        return array == null ? 0 : Array.getLength(array);
    }

    private static boolean isEmpty(Object[] array) {
        return getLength(array) == 0;
    }


    private static boolean isAnyBlank(CharSequence... css) {
        if (isEmpty(css)) {
            return false;
        } else {
            CharSequence[] var1 = css;
            int var2 = css.length;

            for(int var3 = 0; var3 < var2; ++var3) {
                CharSequence cs = var1[var3];
                if (isBlank(cs)) {
                    return true;
                }
            }

            return false;
        }
    }
    public static boolean isNotBlank(CharSequence cs) {
        return !isBlank(cs);
    }
    public static boolean contains(CharSequence seq, int searchChar) {
        if (isEmpty(seq)) {
            return false;
        } else {
            return CharSequenceUtils.indexOf(seq, searchChar, 0) >= 0;
        }
    }

    public static boolean isEmpty(CharSequence cs) {
        return cs == null || cs.length() == 0;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy