Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hamcrest.object
Class IsEventFrom

    java.lang.Object
      org.hamcrest.BaseMatcher<T>
          org.hamcrest.TypeSafeMatcher<EventObject>
              org.hamcrest.object.IsEventFrom

All Implemented Interfaces:
  Matcher<EventObject>, SelfDescribing

    public class IsEventFrom

extends TypeSafeMatcher<EventObject>

Tests if the value is an event announced by a specific object.

Constructor Summary
`IsEventFrom(Class eventClass, Object source)`

Method Summary
`void` | `describeTo(Description description)` Generates a description of the object.
`static Matcher<EventObject>` | `eventFrom(Class<? extends EventObject> eventClass, Object source)` Constructs an IsEventFrom Matcher that returns true for any object derived from eventClass announced by source.
`static Matcher<EventObject>` | `eventFrom(Object source)` Constructs an IsEventFrom Matcher that returns true for any object derived from `EventObject` announced by source .
`boolean` | `matchesSafely(EventObject item)` Subclasses should implement this.

Methods inherited from class org.hamcrest.TypeSafeMatcher
`matches`

Methods inherited from class org.hamcrest.BaseMatcher
`_dont_implement_Matcher___instead_extend_BaseMatcher_, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### IsEventFrom

    public IsEventFrom(Class eventClass,
                       Object source)

Method Detail

### matchesSafely

    public boolean matchesSafely(EventObject item)

  Description copied from class: `TypeSafeMatcher`
  Subclasses should implement this. The item will already have been checked for the specific type and will never be null.

  Specified by:
    `matchesSafely` in class `TypeSafeMatcher<EventObject>`

### describeTo

    public void describeTo(Description description)

  Description copied from interface: `SelfDescribing`
  Generates a description of the object. The description may be part of a a description of a larger object of which this is just a component, so it should be worded appropriately.

  Parameters:
    `description` - The description to be built or appended to.

### eventFrom

    public static Matcher<EventObject> eventFrom(Class<? extends EventObject> eventClass,
                                                 Object source)

  Constructs an IsEventFrom Matcher that returns true for any object derived from eventClass announced by source.

### eventFrom

    public static Matcher<EventObject> eventFrom(Object source)

  Constructs an IsEventFrom Matcher that returns true for any object derived from `EventObject` announced by source .

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD