/** * Returns true if this object matches successfully. * <p> * This method checks for a type match against the erased type of this matcher * and then defers to the {@link #matchesSafely(Object)} of this matcher with the * type-checked and cast object. * * @param object object to be checked * @return {@code true} if the object matches */ public final boolean matches(Object object) { if (boundType.isAssignableFrom(object.getClass())) { return matchesSafely(boundType.cast(object)); } else { return false; } }
/** * Returns true if this object matches successfully. * <p> * This method checks for a type match against the erased type of this matcher * and then defers to the {@link #matchesSafely(Object)} of this matcher with the * type-checked and cast object. * * @param object object to be checked * @return {@code true} if the object matches */ public final boolean matches(Object object) { return boundType.isAssignableFrom(object.getClass()) && matchesSafely(boundType.cast(object)); }
/** * Returns true if this object matches successfully. * <p> * This method checks for a type match against the erased type of this matcher * and then defers to the {@link #matchesSafely(Object)} of this matcher with the * type-checked and cast object. * * @param object object to be checked * @return {@code true} if the object matches */ public final boolean matches(Object object) { if (boundType.isAssignableFrom(object.getClass())) { return matchesSafely(boundType.cast(object)); } else { return false; } }
/** * Returns true if this object matches successfully. * <p> * This method checks for a type match against the erased type of this matcher * and then defers to the {@link #matchesSafely(Object)} of this matcher with the * type-checked and cast object. * * @param object object to be checked * @return {@code true} if the object matches */ public final boolean matches(Object object) { if (boundType.isAssignableFrom(object.getClass())) { return matchesSafely(boundType.cast(object)); } else { return false; } }