// Path: core/src/main/java/com/caseystella/analytics/converters/MappingConverter.java
// public interface MappingConverter extends Converter<Map<String, Object>, byte[]> {
// }
// 
// Path: core/src/main/java/com/caseystella/analytics/converters/TimestampConverter.java
// public interface TimestampConverter extends Converter<Long, Object>{
// }
// 
// Path: core/src/main/java/com/caseystella/analytics/converters/MeasurementConverter.java
// public interface MeasurementConverter extends Converter<Double, Object> {
// }


import com.caseystella.analytics.converters.MappingConverter;
import com.caseystella.analytics.converters.TimestampConverter;
import com.caseystella.analytics.converters.MeasurementConverter;
import com.google.common.base.Function;
import org.apache.hadoop.hbase.util.Bytes;
import java.util.HashMap;
import java.util.Map;
        private Function<byte[], Object> _func;
        Type(Function<byte[], Object> func) {
            _func = func;
        }
        @Override
        public Object apply(byte[] bytes) {
            return _func.apply(bytes);
        }
    }

    public static class PrimitiveMeasurementConverter implements MeasurementConverter {

        @Override
        public Double convert(Object in, Map<String, Object> config) {
            if(in instanceof Double) {
                return (Double)in;
            }
            else if(in instanceof Number) {
                return ((Number)in).doubleValue();
            }
            else if(in instanceof String) {
                return Double.parseDouble(in.toString());
            }
            else
            {
                throw new RuntimeException("Unable to convert " + in + " to a double");
            }
        }
    }

// Path: core/src/main/java/com/caseystella/analytics/converters/MappingConverter.java
// public interface MappingConverter extends Converter<Map<String, Object>, byte[]> {
// }
// 
// Path: core/src/main/java/com/caseystella/analytics/converters/TimestampConverter.java
// public interface TimestampConverter extends Converter<Long, Object>{
// }
// 
// Path: core/src/main/java/com/caseystella/analytics/converters/MeasurementConverter.java
// public interface MeasurementConverter extends Converter<Double, Object> {
// }


// Path: core/src/main/java/com/caseystella/analytics/converters/primitive/PrimitiveConverter.java
import com.caseystella.analytics.converters.MappingConverter;
import com.caseystella.analytics.converters.TimestampConverter;
import com.caseystella.analytics.converters.MeasurementConverter;
import com.google.common.base.Function;
import org.apache.hadoop.hbase.util.Bytes;
import java.util.HashMap;
import java.util.Map;

        private Function<byte[], Object> _func;
        Type(Function<byte[], Object> func) {
            _func = func;
        }
        @Override
        public Object apply(byte[] bytes) {
            return _func.apply(bytes);
        }
    }

    public static class PrimitiveMeasurementConverter implements MeasurementConverter {

        @Override
        public Double convert(Object in, Map<String, Object> config) {
            if(in instanceof Double) {
                return (Double)in;
            }
            else if(in instanceof Number) {
                return ((Number)in).doubleValue();
            }
            else if(in instanceof String) {
                return Double.parseDouble(in.toString());
            }
            else
            {
                throw new RuntimeException("Unable to convert " + in + " to a double");
            }
        }
    }

    public static class PrimitiveTimestampConverter implements TimestampConverter{