Class GObjects

java.lang.Object
com.glitchybyte.glib.GObjects

public final class GObjects extends Object
Object utilities.
  • Method Details

    • castOrNull

      public static <T> T castOrNull(Object obj, Class<T> tClass)
      Tests if obj is of type tClass and returns the same object of that type. If it's not of the type, it returns null.
      Type Parameters:
      T - Type of returned object.
      Parameters:
      obj - Object to test and return.
      tClass - Class we want the object to be.
      Returns:
      obj cast as tClass or null.