<code>null</code>-safe helper method to determine the class of an object.

@param aObject
The object to query. May be <code>null</code>.
@return <code>null</code> if the passed object is <code>null</code>.
543245
@Nullable
  public static Class <?> getClass (@Nullable final Object aObject)
  {
    return aObject == null ? null : aObject.getClass ();
  }
1020737
public static boolean determineObject(String key) {
        if (!exists()) {
            throwThreadCacheNotInitializedException(key);
        }
        final Object obj = threadLocal.get().get(key);
        return obj != null && (boolean) obj;
    }
907101
@Nullable
  public static Long parseLongObj (@Nullable final Object aObject)
  {
    return parseLongObj (aObject, DEFAULT_RADIX, null);
  }
411936
public T getObject(String key) {
        if (this.objects.containsKey(key)) {
            return this.objects.get(key);
        }
        return null;
    }
822572
public <T> T getAnnotation(Class<T> annotationClass) {
        for (Annotation annotation : m_annotations) {
            if (annotation.annotationType().equals(annotationClass)){
                return (T) annotation;
            }
        }
        return null;
    }
455819
public static Method getAccessibleMethod(final Object obj, final String methodName, final Class<?>... parameterTypes) {
		Asserts.notNull(obj, "object cannot be null.");

		for (Class<?> superClass = obj.getClass(); superClass != Object.class; superClass = superClass.getSuperclass()) {
			try {
				Method method = superClass.getDeclaredMethod(methodName, parameterTypes);
				method.setAccessible(true);
				return method;
			} catch (NoSuchMethodException e) {//NOSONAR
				// Method不在当前类定义,继续向上转型
			}
		}
		return null;
	}
221853
public Class<?> getRawClass() {
		Type rawType = this.type;
		if (rawType instanceof ParameterizedType) {
			rawType = ((ParameterizedType) rawType).getRawType();
		}
		return (rawType instanceof Class ? (Class<?>) rawType : null);
	}
1033543
public static String getIssuerFromSamlObject(final SAMLObject object) {
        if (object instanceof RequestAbstractType) {
            return RequestAbstractType.class.cast(object).getIssuer().getValue();
        }
        if (object instanceof StatusResponseType) {
            return StatusResponseType.class.cast(object).getIssuer().getValue();
        }
        return null;
    }
150326
private XAnnotationInvocationHandler asOneOfUs(Object o) {
		if (Proxy.isProxyClass(o.getClass())) {
			InvocationHandler handler = Proxy.getInvocationHandler(o);
			if (handler instanceof XAnnotationInvocationHandler)
				return (XAnnotationInvocationHandler) handler;
		}
		return null;
	}
1071474
public static String getClassName(Object obj, boolean isSimple) {
		if (null == obj) {
			return null;
		}
		final Class<?> clazz = obj.getClass();
		return getClassName(clazz, isSimple);
	}
403437
public static <T> Optional<T> cast(final Object o, final Class<T> clazz) {
        T result = null;
        /*
         * There is no null pointer checking for clazz to detect logic errors.
         */
        if (o != null && clazz.isInstance(o)) {
            result = (T) o;
        }
        return Optional.ofNullable(result);
    }
165831
@Nonnull
  public static Class <?> [] getClassArray (@Nullable final Object... aObjs)
  {
    if (ArrayHelper.isEmpty (aObjs))
      return EMPTY_CLASS_ARRAY;

    final Class <?> [] ret = new Class <?> [aObjs.length];
    for (int i = 0; i < aObjs.length; ++i)
      ret[i] = aObjs[i].getClass ();
    return ret;
  }
901419
T getObjectAt(final int rowIndex) {
		// getSelectedRow peut renvoyer une ligne qui n'est plus dans la table
		// si c'est la dernière sélectionnée
		if (rowIndex < 0 || rowIndex >= getRowCount()) {
			return null;
		}

		final int row = convertRowIndexToModel(rowIndex);

		return getListTableModel().getObjectAt(row);
	}
107393
public static boolean isObjectAnObject(java.lang.Object o) {
    return o instanceof JavaScriptObject && isValueObject(wrap0(o));
  }
481990
public static boolean isAbstractClass (@Nullable final Class <?> aClass)
  {
    // Special case for arrays (see documentation of Class.getModifiers: only
    // final and interface are set, the rest is indeterministic)
    return aClass != null && !aClass.isArray () && Modifier.isAbstract (aClass.getModifiers ());
  }
563767
public static <T> @NonNull Optional<T> cast(final @Nullable Object object, final @NonNull Class<T> type) {
    return type.isInstance(object) ? Optional.of((T) object) : Optional.empty();
  }
27271
public static <T> T castIfInstance(Object o, Class<T> c) {
        return o != null && c.isInstance(o) ? c.cast(o) : null;
    }