001package arez.spy; 002 003import java.util.Map; 004import java.util.Objects; 005import javax.annotation.Nonnull; 006 007/** 008 * Notification that Task is starting. 009 */ 010public final class TaskStartEvent 011 implements SerializableEvent 012{ 013 @Nonnull 014 private final TaskInfo _task; 015 016 public TaskStartEvent( @Nonnull final TaskInfo task ) 017 { 018 _task = Objects.requireNonNull( task ); 019 } 020 021 @Nonnull 022 public TaskInfo getTask() 023 { 024 return _task; 025 } 026 027 @Override 028 public void toMap( @Nonnull final Map<String, Object> map ) 029 { 030 map.put( "type", "TaskStart" ); 031 map.put( "name", getTask().getName() ); 032 } 033}