Java Number Min Value minSize(String str, int min, boolean nullCheck)

Here you can find the source of minSize(String str, int min, boolean nullCheck)

Description

min Size

License

Apache License

Declaration

public static boolean minSize(String str, int min, boolean nullCheck) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static boolean minSize(String str, int min, boolean nullCheck) {
        if (nullCheck == false || isRequired(str)) {

            if (str == null) {
                return true;
            }/* www. j  av  a  2 s.  co  m*/

            int len = str.trim().getBytes().length;

            if (len >= min) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }

    public static boolean isRequired(String str) {
        if (str == null || str.trim().length() == 0) {
            return false;
        }

        return true;
    }
}

Related

  1. minPower2(int n)
  2. minRunLength(int n)
  3. minShareLifetime(long shareLifetime1, long shareLifetime2)
  4. minSignedIntForBitSize(final int bitSize)
  5. minSignedIntForBitSize_noCheck(final int bitSize)
  6. minSPSForBandCode(String bandCode)
  7. minToS(long s)
  8. minUnsigned(long a, long b)
  9. minusxx(String str11, String str22)