001package arez.spy;
002
003import java.util.Map;
004import java.util.Objects;
005import javax.annotation.Nonnull;
006
007/**
008 * Notification when a Component is starting to be created.
009 */
010public final class ComponentCreateStartEvent
011  implements SerializableEvent
012{
013  @Nonnull
014  private final ComponentInfo _componentInfo;
015
016  public ComponentCreateStartEvent( @Nonnull final ComponentInfo componentInfo )
017  {
018    _componentInfo = Objects.requireNonNull( componentInfo );
019  }
020
021  @Nonnull
022  public ComponentInfo getComponentInfo()
023  {
024    return _componentInfo;
025  }
026
027  @Override
028  public void toMap( @Nonnull final Map<String, Object> map )
029  {
030    map.put( "type", "ComponentCreateStart" );
031    map.put( "name", getComponentInfo().getName() );
032  }
033}