package com.codeaffine.home.control.status.supplier;

import static com.codeaffine.util.ArgumentVerification.verifyNotNull;

import java.util.HashMap;
import java.util.Map;

import com.codeaffine.home.control.status.model.SectionProvider.SectionDefinition;

public class LightStatus {

  static final Integer FALL_BACK_LIGHT_VALUE = Integer.valueOf( 0 );

  private final Map<SectionDefinition, Integer> statusMap;

  public LightStatus( Map<SectionDefinition, Integer> statusMap ) {
    verifyNotNull( statusMap, "statusMap" );

    this.statusMap = new HashMap<>( statusMap );
  }

  public int getLightValue( SectionDefinition sectionDefinition ) {
    verifyNotNull( sectionDefinition, "sectionDefinition" );

    if( statusMap.containsKey( sectionDefinition ) ) {
      return statusMap.get( sectionDefinition ).intValue();
    }
    return FALL_BACK_LIGHT_VALUE.intValue();
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + statusMap.hashCode();
    return result;
  }

  @Override
  public boolean equals( Object obj ) {
    if( this == obj )
      return true;
    if( obj == null )
      return false;
    if( getClass() != obj.getClass() )
      return false;
    LightStatus other = ( LightStatus )obj;
    if( !statusMap.equals( other.statusMap ) )
      return false;
    return true;
  }

  @Override
  public String toString() {
    return "LightStatus [ " + statusMap + " ]";
  }


}
@@ -1445,16 +1445,75 @@
 tatusMap
+.toString().replaceAll( %22%5C%5C%7B%22, %22%22 ).replaceAll( %22%5C%5C%7D%22, %22%22 )
  + %22 %5D%22;
@@ -1517,11 +1517,9 @@
 %5D%22;%0A  %7D%0A
-%0A%0A
 %7D

Change to String format of LightStatus