Klasse CastUtil

java.lang.Object
info.u_team.u_team_core.util.CastUtil

public class CastUtil extends Object
Utility methods for casts
  • Konstruktordetails

    • CastUtil

      public CastUtil()
  • Methodendetails

    • uncheckedCast

      public static <T> T uncheckedCast(Object object) throws ClassCastException
      Convenient helper method for unchecked class without suppressing warnings. CAREFULL, CAST IS STILL UNCHECKED!
      Typparameter:
      T - The type that the object should be
      Parameter:
      object - The object
      Gibt zurück:
      Casted object to the desired type
      Löst aus:
      ClassCastException - when unchecked cast fails
    • assertCast

      public static <T> T assertCast(Object object, Class<T> clazz)