private RetryStrategy decodeRetryStrategy(Bundle data) {
    int policy = data.getInt(prefix + BundleProtocol.PACKED_PARAM_RETRY_STRATEGY_POLICY);
    if (policy != RetryStrategy.RETRY_POLICY_EXPONENTIAL
        && policy != RetryStrategy.RETRY_POLICY_LINEAR) {

      return RetryStrategy.DEFAULT_EXPONENTIAL;
    }

    // noinspection WrongConstant
    return new RetryStrategy(
        policy,
        data.getInt(prefix + BundleProtocol.PACKED_PARAM_RETRY_STRATEGY_INITIAL_BACKOFF_SECONDS),
        data.getInt(prefix + BundleProtocol.PACKED_PARAM_RETRY_STRATEGY_MAXIMUM_BACKOFF_SECONDS));
  }
JobCoder is a tool to encode and decode JobSpecs from Bundles.
jobdispatcher/src/main/java/com/firebase/jobdispatcher/JobCoder.java