001package arez.spy; 002 003import java.util.Map; 004import java.util.Objects; 005import javax.annotation.Nonnull; 006 007/** 008 * Notification when Observer is about to call method being observed. 009 */ 010public final class ObserveStartEvent 011 implements SerializableEvent 012{ 013 @Nonnull 014 private final ObserverInfo _observer; 015 016 public ObserveStartEvent( @Nonnull final ObserverInfo observer ) 017 { 018 _observer = Objects.requireNonNull( observer ); 019 } 020 021 @Nonnull 022 public ObserverInfo getObserver() 023 { 024 return _observer; 025 } 026 027 @Override 028 public void toMap( @Nonnull final Map<String, Object> map ) 029 { 030 map.put( "type", "ObserveStart" ); 031 map.put( "name", getObserver().getName() ); 032 } 033}