// Path: tweakable-annotations/src/main/java/com/jackwink/tweakable/exceptions/FailedToBuildPreferenceException.java
// public class FailedToBuildPreferenceException extends RuntimeException {
//     public static final long serialVersionUID = 0L;
// 
//     public FailedToBuildPreferenceException(String reason) {
//         super(reason);
//     }
// 
//     public FailedToBuildPreferenceException(String reason, Throwable rootCause) {
//         super(reason, rootCause);
//     }
// }


import android.content.SharedPreferences;
import com.jackwink.tweakable.exceptions.FailedToBuildPreferenceException;
import java.lang.reflect.Field;
package com.jackwink.tweakable.binders;





/**
 *
 */
public class FloatValueBinder extends AbstractValueBinder<Float> {

    public FloatValueBinder(Field field) {
        mField = field;
    }

    @Override
    public Class<Float> getType() {
        return Float.class;
    }

    @Override
    public void bindValue(SharedPreferences preferences, String key) {
        try {
            if (mField.getType().equals(Float.class)) {
                mField.set(null, preferences.getFloat(key, getValue()));
            } else if (mField.getType().equals(float.class)) {
                mField.setFloat(null, preferences.getFloat(key, getValue()));
            }
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
    }

    @Override
    public Float getValue() {
        try {
            if (mField.getType().equals(float.class)) {
                return mField.getFloat(null);
            } else if (mField.getType().equals(Float.class)) {
                return (Float) mField.get(null);
            }
// Path: tweakable-annotations/src/main/java/com/jackwink/tweakable/exceptions/FailedToBuildPreferenceException.java
// public class FailedToBuildPreferenceException extends RuntimeException {
//     public static final long serialVersionUID = 0L;
// 
//     public FailedToBuildPreferenceException(String reason) {
//         super(reason);
//     }
// 
//     public FailedToBuildPreferenceException(String reason, Throwable rootCause) {
//         super(reason, rootCause);
//     }
// }


// Path: tweakable/src/main/java/com/jackwink/tweakable/binders/FloatValueBinder.java
import android.content.SharedPreferences;
import com.jackwink.tweakable.exceptions.FailedToBuildPreferenceException;
import java.lang.reflect.Field;

package com.jackwink.tweakable.binders;





/**
 *
 */
public class FloatValueBinder extends AbstractValueBinder<Float> {

    public FloatValueBinder(Field field) {
        mField = field;
    }

    @Override
    public Class<Float> getType() {
        return Float.class;
    }

    @Override
    public void bindValue(SharedPreferences preferences, String key) {
        try {
            if (mField.getType().equals(Float.class)) {
                mField.set(null, preferences.getFloat(key, getValue()));
            } else if (mField.getType().equals(float.class)) {
                mField.setFloat(null, preferences.getFloat(key, getValue()));
            }
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
    }

    @Override
    public Float getValue() {
        try {
            if (mField.getType().equals(float.class)) {
                return mField.getFloat(null);
            } else if (mField.getType().equals(Float.class)) {
                return (Float) mField.get(null);
            }
            throw new FailedToBuildPreferenceException(