// 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;




/**
 * Binds an integer value to a static field
 */
public class IntegerValueBinder extends AbstractValueBinder<Integer> {

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

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

    @Override
    public Integer getValue() {
        try {
            if (mField.getType().equals(int.class)) {
                return mField.getInt(null);
            } else if (mField.getType().equals(Integer.class)) {
                return (Integer) mField.get(null);
            }
            throw new FailedToBuildPreferenceException(
                    "Field " + mField.getName() + " is not an integer.");
        } catch (IllegalAccessException e) {
// 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/IntegerValueBinder.java
import android.content.SharedPreferences;
import com.jackwink.tweakable.exceptions.FailedToBuildPreferenceException;
import java.lang.reflect.Field;

package com.jackwink.tweakable.binders;




/**
 * Binds an integer value to a static field
 */
public class IntegerValueBinder extends AbstractValueBinder<Integer> {

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

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

    @Override
    public Integer getValue() {
        try {
            if (mField.getType().equals(int.class)) {
                return mField.getInt(null);
            } else if (mField.getType().equals(Integer.class)) {
                return (Integer) mField.get(null);
            }
            throw new FailedToBuildPreferenceException(
                    "Field " + mField.getName() + " is not an integer.");
        } catch (IllegalAccessException e) {
            throw new FailedToBuildPreferenceException(