Class Preconditions

java.lang.Object
com.github.scribejava.core.utils.Preconditions

public abstract class Preconditions
extends java.lang.Object
Utils for checking preconditions and invariants
  • Constructor Summary

    Constructors
    Constructor Description
    Preconditions()  
  • Method Summary

    Modifier and Type Method Description
    static void checkEmptyString​(java.lang.String string, java.lang.String errorMsg)
    Checks that a string is not null or empty
    static void checkNotNull​(java.lang.Object object, java.lang.String errorMsg)
    Checks that an object is not null.
    static boolean hasText​(java.lang.String str)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Preconditions

      public Preconditions()
  • Method Details

    • checkNotNull

      public static void checkNotNull​(java.lang.Object object, java.lang.String errorMsg)
      Checks that an object is not null.
      Parameters:
      object - any object
      errorMsg - error message
      Throws:
      java.lang.IllegalArgumentException - if the object is null
    • checkEmptyString

      public static void checkEmptyString​(java.lang.String string, java.lang.String errorMsg)
      Checks that a string is not null or empty
      Parameters:
      string - any string
      errorMsg - error message
      Throws:
      java.lang.IllegalArgumentException - if the string is null or empty
    • hasText

      public static boolean hasText​(java.lang.String str)