package com.timgroup.tucker.info.component;

import com.timgroup.tucker.info.Component;
import com.timgroup.tucker.info.Report;
import com.timgroup.tucker.info.Status;

public final class SimpleValueComponent extends Component {

    // hold status and value together for thread safety
    private SimpleValueComponent.StateHolder state = new StateHolder(Status.INFO, ""); 

    public SimpleValueComponent(String id, String label) {
        super(id, label);
    }

    public void updateValue(Status status, Object value) {
        state = new StateHolder(status, value);
    }

    @Override public Report getReport() {
        SimpleValueComponent.StateHolder currentState = state;
        return new Report(currentState.status, currentState.value);
    }

    private static final class StateHolder {
        public final Status status;
        public final Object value;
        private StateHolder(Status status, Object value) {
            this.status = status;
            this.value = value;
        }
    }
}
@@ -231,104 +231,22 @@
     
-// hold status and value together for thread safety%0A    private SimpleValueComponent.StateHolder
+private Report
  sta
@@ -254,27 +254,22 @@
 e = new 
-StateHolder
+Report
 (Status.
@@ -278,17 +278,16 @@
 FO, %22%22);
- 
 %0A%0A    pu
@@ -451,27 +451,22 @@
 e = new 
-StateHolder
+Report
 (status,
@@ -494,16 +494,20 @@
 Override
+%0A   
  public 
@@ -539,392 +539,27 @@
     
-SimpleValueComponent.StateHolder currentState = state;%0A        return new Report(currentState.status, currentState.value);%0A    %7D%0A%0A    private static final class StateHolder %7B%0A        public final Status status;%0A        public final Object value;%0A        private StateHolder(Status status, Object value) %7B%0A            this.status = status;%0A            this.value = value;%0A        %7D%0A    %7D%0A%7D
+return state;%0A    %7D%0A%0A%7D%0A

Simplify the SimpleValueComponent