// Path: tweakable-annotations/src/main/java/com/jackwink/tweakable/types/TweakableBoolean.java
// public class TweakableBoolean extends AbstractTweakableValue<Boolean> {
//     private static final String TAG = TweakableBoolean.class.getSimpleName();
// 
//     public static final String BUNDLE_ON_LABEL_KEY = "switch_text_on";
//     public static final String BUNDLE_OFF_LABEL_KEY = "switch_text_off";
//     public static final String BUNDLE_ON_SUMMARY_KEY = "summary_on";
//     public static final String BUNDLE_OFF_SUMMARY_KEY = "summary_off";
// 
//     private TwkBoolean mParsedAnnotation;
// 
// 
//     public String getOnLabel() {
//         return mParsedAnnotation.onLabel();
//     }
// 
//     public String getOffLabel() {
//         return mParsedAnnotation.offLabel();
//     }
// 
//     public String getOnSummary() {
//         return mParsedAnnotation.onSummary();
//     }
// 
//     public String getOffSummary() {
//         return mParsedAnnotation.offSummary();
//     }
// 
//     @Override
//     public Class<Boolean> getType() {
//         return Boolean.class;
//     }
// 
//     public static TweakableBoolean parse(String className, String fieldName,
//                                          TwkBoolean annotation) {
//         TweakableBoolean returnValue = new TweakableBoolean();
// 
//         /* Abstract Tweakable Values */
//         returnValue.mKey = className + "." + fieldName;
//         returnValue.mTitle = getDefaultString(annotation.title(), fieldName);
//         returnValue.mSummary = annotation.summary();
//         returnValue.mCategory = getDefaultString(annotation.category(), null);
//         returnValue.mScreen = getDefaultString(annotation.screen(), null);
// 
//         /* TweakableBoolean */
//         returnValue.mParsedAnnotation = annotation;
//         return returnValue;
//     }
// 
// }


import android.preference.Preference;
import android.preference.SwitchPreference;
import com.jackwink.tweakable.types.TweakableBoolean;
package com.jackwink.tweakable.builders;




/**
 *
 */
@SuppressWarnings({ "rawtypes" })
public class BooleanPreferenceBuilder extends BasePreferenceBuilder<Preference> {
    private static final String TAG = PreferenceFactory.class.getSimpleName();

    public BooleanPreferenceBuilder() {
    }

    @Override
    public Class[] getHandledTypes() {
        return new Class[] {Boolean.class, boolean.class };
    }

    /**
     * Builds a SwitchPreference object
     */
    @Override
    public Preference build() {
        SwitchPreference preference = null;
        preference = build(SwitchPreference.class, true);
        preference.setChecked((boolean) mDefaultValue);
        preference.setSummaryOn((String)
                getOptionalAttribute(TweakableBoolean.BUNDLE_ON_SUMMARY_KEY));
        preference.setSummaryOff((String)
                getOptionalAttribute(TweakableBoolean.BUNDLE_OFF_SUMMARY_KEY));
        preference.setSwitchTextOn((String)
// Path: tweakable-annotations/src/main/java/com/jackwink/tweakable/types/TweakableBoolean.java
// public class TweakableBoolean extends AbstractTweakableValue<Boolean> {
//     private static final String TAG = TweakableBoolean.class.getSimpleName();
// 
//     public static final String BUNDLE_ON_LABEL_KEY = "switch_text_on";
//     public static final String BUNDLE_OFF_LABEL_KEY = "switch_text_off";
//     public static final String BUNDLE_ON_SUMMARY_KEY = "summary_on";
//     public static final String BUNDLE_OFF_SUMMARY_KEY = "summary_off";
// 
//     private TwkBoolean mParsedAnnotation;
// 
// 
//     public String getOnLabel() {
//         return mParsedAnnotation.onLabel();
//     }
// 
//     public String getOffLabel() {
//         return mParsedAnnotation.offLabel();
//     }
// 
//     public String getOnSummary() {
//         return mParsedAnnotation.onSummary();
//     }
// 
//     public String getOffSummary() {
//         return mParsedAnnotation.offSummary();
//     }
// 
//     @Override
//     public Class<Boolean> getType() {
//         return Boolean.class;
//     }
// 
//     public static TweakableBoolean parse(String className, String fieldName,
//                                          TwkBoolean annotation) {
//         TweakableBoolean returnValue = new TweakableBoolean();
// 
//         /* Abstract Tweakable Values */
//         returnValue.mKey = className + "." + fieldName;
//         returnValue.mTitle = getDefaultString(annotation.title(), fieldName);
//         returnValue.mSummary = annotation.summary();
//         returnValue.mCategory = getDefaultString(annotation.category(), null);
//         returnValue.mScreen = getDefaultString(annotation.screen(), null);
// 
//         /* TweakableBoolean */
//         returnValue.mParsedAnnotation = annotation;
//         return returnValue;
//     }
// 
// }


// Path: tweakable/src/main/java/com/jackwink/tweakable/builders/BooleanPreferenceBuilder.java
import android.preference.Preference;
import android.preference.SwitchPreference;
import com.jackwink.tweakable.types.TweakableBoolean;

package com.jackwink.tweakable.builders;




/**
 *
 */
@SuppressWarnings({ "rawtypes" })
public class BooleanPreferenceBuilder extends BasePreferenceBuilder<Preference> {
    private static final String TAG = PreferenceFactory.class.getSimpleName();

    public BooleanPreferenceBuilder() {
    }

    @Override
    public Class[] getHandledTypes() {
        return new Class[] {Boolean.class, boolean.class };
    }

    /**
     * Builds a SwitchPreference object
     */
    @Override
    public Preference build() {
        SwitchPreference preference = null;
        preference = build(SwitchPreference.class, true);
        preference.setChecked((boolean) mDefaultValue);
        preference.setSummaryOn((String)
                getOptionalAttribute(TweakableBoolean.BUNDLE_ON_SUMMARY_KEY));
        preference.setSummaryOff((String)
                getOptionalAttribute(TweakableBoolean.BUNDLE_OFF_SUMMARY_KEY));
        preference.setSwitchTextOn((String)
                getOptionalAttribute(TweakableBoolean.BUNDLE_ON_LABEL_KEY));