private void encodeRetryStrategy(RetryStrategy retryStrategy, Bundle data) {
    if (retryStrategy == null) {
      retryStrategy = RetryStrategy.DEFAULT_EXPONENTIAL;
    }

    data.putInt(
        prefix + BundleProtocol.PACKED_PARAM_RETRY_STRATEGY_POLICY, retryStrategy.getPolicy());
    data.putInt(
        prefix + BundleProtocol.PACKED_PARAM_RETRY_STRATEGY_INITIAL_BACKOFF_SECONDS,
        retryStrategy.getInitialBackoff());
    data.putInt(
        prefix + BundleProtocol.PACKED_PARAM_RETRY_STRATEGY_MAXIMUM_BACKOFF_SECONDS,
        retryStrategy.getMaximumBackoff());
  }
JobCoder is a tool to encode and decode JobSpecs from Bundles.
jobdispatcher/src/main/java/com/firebase/jobdispatcher/JobCoder.java