public static Config load(final Context context) {
    final SharedPreferences sharedPreferences =
        // NULLSAFE_FIXME[Not Vetted Third-Party]
        PreferenceManager.getDefaultSharedPreferences(context);
    return Builder.newBuilder()
        .setDataSourceType(
            // NULLSAFE_FIXME[Parameter Not Nullable]
            sharedPreferences.getString(
                Const.DATA_SOURCE_KEY, context.getString(R.string.value_local_uri)))
        .setInfiniteDataSource(sharedPreferences.getBoolean(Const.INFINITE_DATA_SOURCE_KEY, false))
        .setDistinctUriDataSource(
            sharedPreferences.getBoolean(Const.DISTINCT_DATA_SOURCE_KEY, false))
        .setRecyclerLayoutType(
            // NULLSAFE_FIXME[Parameter Not Nullable]
            sharedPreferences.getString(
                Const.RECYCLER_LAYOUT_KEY,
                context.getString(R.string.value_recyclerview_recycler_layout)))
        .setUseRoundedCorners(sharedPreferences.getBoolean(Const.ROUNDED_CORNERS_KEY, false))
        .setUseRoundedAsCircle(sharedPreferences.getBoolean(Const.ROUNDED_AS_CIRCLE_KEY, false))
        .setUsePostprocessor(sharedPreferences.getBoolean(Const.USE_POSTPROCESSOR_KEY, false))
        .setPostprocessorType(
            // NULLSAFE_FIXME[Parameter Not Nullable]
            sharedPreferences.getString(
                Const.POSTPROCESSOR_TYPE_KEY,
                context.getString(R.string.value_postprocessor_medium)))
        .setScaleType(
            // NULLSAFE_FIXME[Parameter Not Nullable]
            sharedPreferences.getString(
                Const.SCALE_TYPE_KEY, context.getString(R.string.value_scale_type_fit_center)))
        .setRotateUsingMetaData(sharedPreferences.getBoolean(Const.AUTO_ROTATE_KEY, false))
        .setForcedRotationAngle(
            Integer.parseInt(
                Preconditions.checkNotNull(
                    sharedPreferences.getString(Const.FORCED_ROTATION_ANGLE_KEY, "0"))))
        .setDownsampling(sharedPreferences.getBoolean(Const.DOWNSAMPLING_KEY, false))
        .setOverrideSize(sharedPreferences.getBoolean(Const.OVERRIDE_SIZE_KEY, false))
        .setOverridenWidth(
            sharedPreferences.getInt(Const.OVERRIDEN_WIDTH_KEY, SizeUtil.DISPLAY_WIDTH / 2))
        .setOverridenHeight(
            sharedPreferences.getInt(Const.OVERRIDEN_HEIGHT_KEY, SizeUtil.DISPLAY_HEIGHT / 2))
        .setFadeDurationMs(
            Integer.parseInt(
                // NULLSAFE_FIXME[Parameter Not Nullable]
                sharedPreferences.getString(
                    Const.FADE_DURATION_KEY, context.getString(R.string.value_fast_fade_duration))))
        .setDrawBorder(sharedPreferences.getBoolean(Const.DRAW_BORDER_KEY, false))
        .setGridSpanCount(
            Integer.parseInt(
                Preconditions.checkNotNull(
                    sharedPreferences.getString(Const.GRID_SPAN_COUNT_KEY, "3"))))
        .setDecodeCancellation(sharedPreferences.getBoolean(Const.DECODE_CANCELLATION_KEY, false))
        .setVitoOverlayEnabled(sharedPreferences.getBoolean(Const.VITO_OVERLAY_KEY, false))
        .setInstrumentationEnabled(
            sharedPreferences.getBoolean(Const.INSTRUMENTATION_ENABLED_KEY, false))
        .setDecodingThreadCount(
            Integer.parseInt(
                Preconditions.checkNotNull(
                    sharedPreferences.getString(Const.DECODING_THREAD_KEY, "0"))))
        .setBgColor(
            Integer.parseInt(
                Preconditions.checkNotNull(sharedPreferences.getString(Const.BG_COLOR_KEY, "0"))))
        .build();
  }
We use this class to keep in memory all the information from the Settings. It's a kind of buffer
of those information in order to avoid repeated reading
samples/scrollperf/src/main/java/com/facebook/samples/scrollperf/conf/Config.java