// Path: src/main/java/com/github/kaklakariada/fritzbox/helper/StringHelper.java
// public class StringHelper {
//     
//     private StringHelper(){
//         // Not instantiable
//     }
//     
//     /**
//      * <p>Note that the method does not allow for a leading sign, either positive or negative.</p>
//      * 
//      * <pre>
//      * StringUtils.isIntegerNumber(null)  = false
//      * StringHelper.isIntegerNumber(""))  = false
//      * StringHelper.isIntegerNumber(" ")  = false
//      * StringHelper.isIntegerNumber(" 1 ") = true
//      * StringHelper.isIntegerNumber("123")  = true
//      * StringUtils.isIntegerNumber("\u0967\u0968\u0969")  = true
//      * StringHelper.isIntegerNumber("1.1") = false
//      * StringHelper.isIntegerNumber("1.1D") = false
//      * </pre>
//      * 
//      * 
//      * @param cs  the String to check, may be null
//      * @return {@code true} if only contains digits or is enclosed by blanks, and is non-null
//      */
//     public static boolean isIntegerNumber(final String cs) {
//         if (isEmpty(cs) || !isNumeric(cs.trim())) {
//             return false;
//         }
//         try {
//             Integer.parseInt(cs.trim());
//         } catch (NumberFormatException nfe) {
//             return false;
//         }
//         return true;
//     }
//     
//     /**
//      * <h4>Code copied 'as is' from apache-commons-lang3, class StringUtils.isNumeric()</h4>
//      * 
//      * <p>Checks if the CharSequence contains only Unicode digits.
//      * A decimal point is not a Unicode digit and returns false.</p>
//      *
//      * <p>{@code null} will return {@code false}.
//      * An empty CharSequence (length()=0) will return {@code false}.</p>
//      *
//      * <p>Note that the method does not allow for a leading sign, either positive or negative.
//      * Also, if a String passes the numeric test, it may still generate a NumberFormatException
//      * when parsed by Integer.parseInt or Long.parseLong, e.g. if the value is outside the range
//      * for int or long respectively.</p>
//      *
//      * <pre>
//      * StringUtils.isNumeric(null)   = false
//      * StringUtils.isNumeric("")     = false
//      * StringUtils.isNumeric("  ")   = false
//      * StringUtils.isNumeric("123")  = true
//      * StringUtils.isNumeric("\u0967\u0968\u0969")  = true
//      * StringUtils.isNumeric("12 3") = false
//      * StringUtils.isNumeric("ab2c") = false
//      * StringUtils.isNumeric("12-3") = false
//      * StringUtils.isNumeric("12.3") = false
//      * StringUtils.isNumeric("-123") = false
//      * StringUtils.isNumeric("+123") = false
//      * </pre>
//      *
//      * @param cs  the CharSequence to check, may be null
//      * @return {@code true} if only contains digits, and is non-null
//      */
//     public static boolean isNumeric(final CharSequence cs) {
//         if (isEmpty(cs)) {
//             return false;
//         }
//         final int sz = cs.length();
//         for (int i = 0; i < sz; i++) {
//             if (!Character.isDigit(cs.charAt(i))) {
//                 return false;
//             }
//         }
//         return true;
//     }
//     
//     
//     /**
//      * <h4>Code copied 'as is' from apache-commons-lang3, class StringUtils.isEmpty()</h4>
//      * 
//      * <p>Checks if a CharSequence is empty ("") or null.</p>
//      *
//      * <pre>
//      * StringUtils.isEmpty(null)      = true
//      * StringUtils.isEmpty("")        = true
//      * StringUtils.isEmpty(" ")       = false
//      * StringUtils.isEmpty("bob")     = false
//      * StringUtils.isEmpty("  bob  ") = false
//      * </pre>
//      *
//      *
//      * @param cs  the CharSequence to check, may be null
//      * @return {@code true} if the CharSequence is empty or null
//      */
//     public static boolean isEmpty(final CharSequence cs) {
//         return cs == null || cs.length() == 0;
//     }
// }


import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Root;
import org.simpleframework.xml.Text;
import com.github.kaklakariada.fritzbox.helper.StringHelper;
        }
        return Arrays.asList(getCsvValues().split(","))
                .stream()
                .map(aValue -> Optional.ofNullable(computeValue(aValue)))
                .collect(Collectors.toList());
    }

    /**
     * Provide the measurement unit to be used with the statistics.
     * <p>
     * Consists of:
     * <ul>
     * <li>measurment unit [V, W, Wh, %]</li>
     * <li>precision as double to multiply with the gathered Integer</li>
     * </ul>
     * Sample: The Voltage is measured in 'V' (Volt) and has a precision of '0.001'. The number 237123 provided by the
     * statistics must be multiplied by the precision which gives us 237.123 V.
     * 
     * @return
     */
    public MeasurementUnit getMeasurementUnit() {
        return measurementUnit;
    }

    public void setMeasurementUnit(final MeasurementUnit measurementUnit) {
        this.measurementUnit = measurementUnit;
    }

    protected Number computeValue(String aValue) {
        Number numberValue = null;
// Path: src/main/java/com/github/kaklakariada/fritzbox/helper/StringHelper.java
// public class StringHelper {
//     
//     private StringHelper(){
//         // Not instantiable
//     }
//     
//     /**
//      * <p>Note that the method does not allow for a leading sign, either positive or negative.</p>
//      * 
//      * <pre>
//      * StringUtils.isIntegerNumber(null)  = false
//      * StringHelper.isIntegerNumber(""))  = false
//      * StringHelper.isIntegerNumber(" ")  = false
//      * StringHelper.isIntegerNumber(" 1 ") = true
//      * StringHelper.isIntegerNumber("123")  = true
//      * StringUtils.isIntegerNumber("\u0967\u0968\u0969")  = true
//      * StringHelper.isIntegerNumber("1.1") = false
//      * StringHelper.isIntegerNumber("1.1D") = false
//      * </pre>
//      * 
//      * 
//      * @param cs  the String to check, may be null
//      * @return {@code true} if only contains digits or is enclosed by blanks, and is non-null
//      */
//     public static boolean isIntegerNumber(final String cs) {
//         if (isEmpty(cs) || !isNumeric(cs.trim())) {
//             return false;
//         }
//         try {
//             Integer.parseInt(cs.trim());
//         } catch (NumberFormatException nfe) {
//             return false;
//         }
//         return true;
//     }
//     
//     /**
//      * <h4>Code copied 'as is' from apache-commons-lang3, class StringUtils.isNumeric()</h4>
//      * 
//      * <p>Checks if the CharSequence contains only Unicode digits.
//      * A decimal point is not a Unicode digit and returns false.</p>
//      *
//      * <p>{@code null} will return {@code false}.
//      * An empty CharSequence (length()=0) will return {@code false}.</p>
//      *
//      * <p>Note that the method does not allow for a leading sign, either positive or negative.
//      * Also, if a String passes the numeric test, it may still generate a NumberFormatException
//      * when parsed by Integer.parseInt or Long.parseLong, e.g. if the value is outside the range
//      * for int or long respectively.</p>
//      *
//      * <pre>
//      * StringUtils.isNumeric(null)   = false
//      * StringUtils.isNumeric("")     = false
//      * StringUtils.isNumeric("  ")   = false
//      * StringUtils.isNumeric("123")  = true
//      * StringUtils.isNumeric("\u0967\u0968\u0969")  = true
//      * StringUtils.isNumeric("12 3") = false
//      * StringUtils.isNumeric("ab2c") = false
//      * StringUtils.isNumeric("12-3") = false
//      * StringUtils.isNumeric("12.3") = false
//      * StringUtils.isNumeric("-123") = false
//      * StringUtils.isNumeric("+123") = false
//      * </pre>
//      *
//      * @param cs  the CharSequence to check, may be null
//      * @return {@code true} if only contains digits, and is non-null
//      */
//     public static boolean isNumeric(final CharSequence cs) {
//         if (isEmpty(cs)) {
//             return false;
//         }
//         final int sz = cs.length();
//         for (int i = 0; i < sz; i++) {
//             if (!Character.isDigit(cs.charAt(i))) {
//                 return false;
//             }
//         }
//         return true;
//     }
//     
//     
//     /**
//      * <h4>Code copied 'as is' from apache-commons-lang3, class StringUtils.isEmpty()</h4>
//      * 
//      * <p>Checks if a CharSequence is empty ("") or null.</p>
//      *
//      * <pre>
//      * StringUtils.isEmpty(null)      = true
//      * StringUtils.isEmpty("")        = true
//      * StringUtils.isEmpty(" ")       = false
//      * StringUtils.isEmpty("bob")     = false
//      * StringUtils.isEmpty("  bob  ") = false
//      * </pre>
//      *
//      *
//      * @param cs  the CharSequence to check, may be null
//      * @return {@code true} if the CharSequence is empty or null
//      */
//     public static boolean isEmpty(final CharSequence cs) {
//         return cs == null || cs.length() == 0;
//     }
// }


// Path: src/main/java/com/github/kaklakariada/fritzbox/model/homeautomation/Statistics.java
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Root;
import org.simpleframework.xml.Text;
import com.github.kaklakariada.fritzbox.helper.StringHelper;

        }
        return Arrays.asList(getCsvValues().split(","))
                .stream()
                .map(aValue -> Optional.ofNullable(computeValue(aValue)))
                .collect(Collectors.toList());
    }

    /**
     * Provide the measurement unit to be used with the statistics.
     * <p>
     * Consists of:
     * <ul>
     * <li>measurment unit [V, W, Wh, %]</li>
     * <li>precision as double to multiply with the gathered Integer</li>
     * </ul>
     * Sample: The Voltage is measured in 'V' (Volt) and has a precision of '0.001'. The number 237123 provided by the
     * statistics must be multiplied by the precision which gives us 237.123 V.
     * 
     * @return
     */
    public MeasurementUnit getMeasurementUnit() {
        return measurementUnit;
    }

    public void setMeasurementUnit(final MeasurementUnit measurementUnit) {
        this.measurementUnit = measurementUnit;
    }

    protected Number computeValue(String aValue) {
        Number numberValue = null;
        if (StringHelper.isIntegerNumber(aValue)) {