Codota Logo
BasicUtils.judgeNotNull
Code IndexAdd Codota to your IDE (free)

How to use
judgeNotNull
method
in
com.marshalchen.ua.common.commonUtils.basicUtils.BasicUtils

Best Java code snippets using com.marshalchen.ua.common.commonUtils.basicUtils.BasicUtils.judgeNotNull (Showing top 13 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: cymcsg/UltimateAndroid

/**
 * Judge if the ArrayList<String> contains the String variable
 *
 * @param s
 * @param arrayList
 * @return If only a String in ArrayList equals the variable return true
 */
public static boolean ifStringExactlyInList(String s, ArrayList<String> arrayList) {
  if (BasicUtils.judgeNotNull(s) && BasicUtils.judgeNotNull(arrayList)) {
    for (String str : arrayList) {
      if (str.equals(s))
        return true;
    }
  }
  return false;
}
origin: cymcsg/UltimateAndroid

/**
 * Judge if the ArrayList<String> contains the String variable
 * This method judges  trim String.
 *
 * @param s
 * @param arrayList
 * @return If a String in ArrayList contains the variable return true
 */
public static boolean ifStringInList(String s, ArrayList<String> arrayList) {
  if (BasicUtils.judgeNotNull(s) && BasicUtils.judgeNotNull(arrayList)) {
    for (String str : arrayList) {
      if (str.trim().contains(s))
        return true;
    }
  }
  return false;
}
origin: cymcsg/UltimateAndroid

/**
 * Indicates if the file represents a directory exists.
 *
 * @param directoryPath
 * @return
 */
public static boolean isFolderExist(String directoryPath) {
  if (!BasicUtils.judgeNotNull(directoryPath)) {
    return false;
  }
  File dire = new File(directoryPath);
  return (dire.exists() && dire.isDirectory());
}
origin: cymcsg/UltimateAndroid

/**
 * Indicates if the file represents a file exists.
 *
 * @param filePath
 * @return
 */
public static boolean isFileExist(String filePath) {
  if (!BasicUtils.judgeNotNull(filePath)) {
    return false;
  }
  File file = new File(filePath);
  return (file.exists() && file.isFile());
}
origin: cymcsg/UltimateAndroid

/**
 * Initialize
 *
 * @param context
 * @param crashFilePath
 */
public void init(Context context, String crashFilePath, String showMessage) {
  mContext = context;
  mDefaultHandler = Thread.getDefaultUncaughtExceptionHandler();
  Thread.setDefaultUncaughtExceptionHandler(this);
  // this.systemServiceObject = systemServiceObject;
  this.crashFilePath = crashFilePath;
  if (BasicUtils.judgeNotNull(showMessage)) {
    this.showMessage = showMessage;
  }
}
origin: cymcsg/UltimateAndroid

/**
 * Get size of the file
 *
 * @param path
 * @return Return the length of the file in bytes. Return -1 if the file does not exist.
 */
public static long getFileSize(String path) {
  if (!BasicUtils.judgeNotNull(path)) {
    return -1;
  }
  File file = new File(path);
  return (file.exists() && file.isFile() ? file.length() : -1);
}
origin: cymcsg/UltimateAndroid

/**
 * @param list
 * @param lists
 * @return
 * @see #judgeNotNull(java.util.List)
 */
public static boolean judgeNotNull(List list, List... lists) {
  boolean flag = true;
  if (list == null || list.size() == 0) return false;
  if (judgeNotNull(lists))
    for (List l : lists) {
      if (l == null || l.size() == 0) {
        flag = false;
        return false;
      }
    }
  return flag;
}
origin: cymcsg/UltimateAndroid

/**
 * Get extension of the file
 *
 * @param filePath
 * @return
 */
public static String getFileExtension(String filePath) {
  if (!BasicUtils.judgeNotNull(filePath)) {
    return "";
  }
  int extenPosi = filePath.lastIndexOf(".");
  int filePosi = filePath.lastIndexOf(File.separator);
  if (extenPosi == -1) {
    return "";
  }
  return (filePosi >= extenPosi) ? "" : filePath.substring(extenPosi + 1);
}
origin: cymcsg/UltimateAndroid

public void loadRepositoryInfo(Subscriber<RepositoryList> subscriber, String query, String language, String sort, String order) {
  githubApiServiceInterface.getRepositoryBySearch(BasicUtils.judgeNotNull(language) ? query + URLDecoder.decode("+") + "language:" + language : query, sort, order)
      .subscribeOn(Schedulers.io())
      .observeOn(AndroidSchedulers.mainThread())
      .subscribe(subscriber);
}
origin: cymcsg/UltimateAndroid

/**
 * Get file which from assets
 *
 * @param context
 * @param fileName The name of the asset to open.
 * @return
 */
public static String getFileFromAssets(Context context, String fileName) {
  if (context == null || BasicUtils.judgeNotNull(fileName)) {
    return null;
  }
  StringBuilder s = new StringBuilder("");
  try {
    InputStreamReader in = new InputStreamReader(context.getResources().getAssets().open(fileName));
    BufferedReader br = new BufferedReader(in);
    String line;
    while ((line = br.readLine()) != null) {
      s.append(line);
    }
    return s.toString();
  } catch (IOException e) {
    e.printStackTrace();
    return null;
  }
}
origin: cymcsg/UltimateAndroid

/**
 * whether the app whost package's name is packageName is on the top of the stack
 * <ul>
 * Attentions:
 * <li>You should add android.permission.GET_TASKS in manifest</li>
 * </ul>
 *
 * @param context
 * @param packageName
 * @return if params error or task stack is null, return null, otherwise retun whether the app is on the top of
 * stack
 */
public static Boolean isTopActivity(Context context, String packageName) {
  if (context == null || !BasicUtils.judgeNotNull(packageName)) {
    return null;
  }
  ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
  List<RunningTaskInfo> tasksInfo = activityManager.getRunningTasks(1);
  if (!BasicUtils.judgeNotNull(tasksInfo)) {
    return null;
  }
  try {
    return packageName.equals(tasksInfo.get(0).topActivity.getPackageName());
  } catch (Exception e) {
    e.printStackTrace();
    return false;
  }
}
origin: cymcsg/UltimateAndroid

if (BasicUtils.judgeNotNull(content)) {
  return false;
origin: cymcsg/UltimateAndroid

        (BasicUtils.judgeNotNull(crashFilePath) ? crashFilePath : "/crash/");
Logs.d("path----" + path);
File dir = new File(path);
com.marshalchen.ua.common.commonUtils.basicUtilsBasicUtilsjudgeNotNull

Javadoc

Judge if the Object is null

Popular methods of BasicUtils

  • iterateHashMapConcurrent
    Print all items of HashMap,avoid ConcurrentModificationExceptions

Popular in Java

  • Updating database using SQL prepared statement
  • getContentResolver (Context)
  • startActivity (Activity)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Table (org.hibernate.mapping)
    A relational table
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now