package org.realityforge.replicant.client;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * An event indicating that an imitation has changed.
 */
public final class EntityChangeEvent
{
  private final EntityChangeType _type;
  private final Object _object;
  private final String _name;
  private final Object _value;

  public EntityChangeEvent( @Nonnull final EntityChangeType type, @Nonnull final Object object )
  {
    this( type, object, null, null );
  }

  @SuppressWarnings( { "ConstantConditions" } )
  public EntityChangeEvent( @Nonnull final EntityChangeType type,
                            @Nonnull final Object object,
                            @Nullable final String name,
                            @Nullable final Object value )
  {
    if ( null == type )
    {
      throw new NullPointerException( "type" );
    }
    if ( null == object )
    {
      throw new NullPointerException( "object" );
    }
    _type = type;
    _object = object;
    _name = name;
    _value = value;
  }

  @Nonnull
  public final EntityChangeType getType()
  {
    return _type;
  }

  @Nonnull
  public final Object getObject()
  {
    return _object;
  }

  @Nullable
  public final String getName()
  {
    return _name;
  }

  @Nullable
  public final Object getValue()
  {
    return _value;
  }

  public final String toString()
  {
    final StringBuilder sb = new StringBuilder();
    sb.append( "EntityChange[type=" );
    sb.append( getType().name() );
    sb.append( ",name=" );
    sb.append( getName() );
    sb.append( ",value=" );
    sb.append( getValue() );
    sb.append( ",object=" );
    sb.append( getObject() );
    sb.append( "]" );
    return sb.toString();
  }
}

@@ -347,205 +347,16 @@
 %0A  p
-ublic EntityChangeEvent( @Nonnull final EntityChangeType type, @Nonnull final Object object )%0A  %7B%0A    this( type, object, null, null );%0A  %7D%0A%0A  @SuppressWarnings( %7B %22ConstantConditions%22 %7D )%0A  public
+rotected
  Ent
@@ -437,16 +437,19 @@
         
+ 
+  
 @Nonnull
@@ -490,32 +490,35 @@
                 
+   
 @Nullable final 
@@ -550,32 +550,35 @@
                 
+ 
+  
 @Nullable final 
@@ -600,180 +600,8 @@
   %7B%0A
-    if ( null == type )%0A    %7B%0A      throw new NullPointerException( %22type%22 );%0A    %7D%0A    if ( null == object )%0A    %7B%0A      throw new NullPointerException( %22object%22 );%0A    %7D%0A
     
@@ -977,16 +977,47 @@
 e;%0A  %7D%0A%0A
+  /**%0A   * %7B@inheritDoc%7D%0A   */%0A
   public

Simplify the construction of change events and make them protected