urbanairship-core/src/main/java/com/urbanairship/job/JobInfo.java
@Nullable
    public static JobInfo fromBundle(Bundle bundle) {
        if (bundle == null) {
            return new Builder().build();
        }

        try {
            JobInfo.Builder builder = new Builder()
                    .setAction(bundle.getString(EXTRA_JOB_ACTION))
                    .setInitialDelay(bundle.getLong(EXTRA_INITIAL_DELAY, 0), TimeUnit.MILLISECONDS)
                    .setExtras(JsonValue.parseString(bundle.getString(EXTRA_JOB_EXTRAS)).optMap())
                    .setAirshipComponent(bundle.getString(EXTRA_AIRSHIP_COMPONENT))
                    .setNetworkAccessRequired(bundle.getBoolean(EXTRA_IS_NETWORK_ACCESS_REQUIRED))
                    .setPersistent(bundle.getBoolean(EXTRA_PERSISTENT));

            //noinspection WrongConstant
            builder.setId(bundle.getInt(EXTRA_JOB_ID, 0));

            return builder.build();

        } catch (IllegalArgumentException | JsonException e) {
            Logger.error("Failed to parse job from bundle.", e);
        }

        return null;
    }
/**
     * Creates a jobInfo from a bundle.
     *
     * @param bundle The job bundle.
     * @return JobInfo builder.
     */
Creates a jobInfo from a bundle.
@param bundle The job bundle.
Creates a jobInfo from a bundle . @param bundle The job bundle .
@Nullable
    public static JobInfo fromBundle(Bundle bundle) {
        if (bundle == null) {
            return new Builder().build();
        }
        try {
            JobInfo.Builder builder = new Builder()
                    .setAction(bundle.getString(EXTRA_JOB_ACTION))
                    .setInitialDelay(bundle.getLong(EXTRA_INITIAL_DELAY, 0), TimeUnit.MILLISECONDS)
                    .setExtras(JsonValue.parseString(bundle.getString(EXTRA_JOB_EXTRAS)).optMap())
                    .setAirshipComponent(bundle.getString(EXTRA_AIRSHIP_COMPONENT))
                    .setNetworkAccessRequired(bundle.getBoolean(EXTRA_IS_NETWORK_ACCESS_REQUIRED))
                    .setPersistent(bundle.getBoolean(EXTRA_PERSISTENT));
            builder.setId(bundle.getInt(EXTRA_JOB_ID, 0));
            return builder.build();
        } catch (IllegalArgumentException | JsonException e) {
            Logger.error("Failed to parse job from bundle.", e);
        }
        return null;
    }
@ Nullable public static JobInfo fromBundle ( Bundle bundle ) { if ( bundle == null ) { return new Builder ( ) . build ( ) ; } try { JobInfo . Builder builder = new Builder ( ) . setAction ( bundle . getString ( EXTRA_JOB_ACTION ) ) . setInitialDelay ( bundle . getLong ( EXTRA_INITIAL_DELAY , 0 ) , TimeUnit . MILLISECONDS ) . setExtras ( JsonValue . parseString ( bundle . getString ( EXTRA_JOB_EXTRAS ) ) . optMap ( ) ) . setAirshipComponent ( bundle . getString ( EXTRA_AIRSHIP_COMPONENT ) ) . setNetworkAccessRequired ( bundle . getBoolean ( EXTRA_IS_NETWORK_ACCESS_REQUIRED ) ) . setPersistent ( bundle . getBoolean ( EXTRA_PERSISTENT ) ) ; builder . setId ( bundle . getInt ( EXTRA_JOB_ID , 0 ) ) ; return builder . build ( ) ; } catch ( IllegalArgumentException | JsonException e ) { Logger . error ( "Failed to parse job from bundle." , e ) ; } return null ; }
Creates a jobInfo from a bundle.
Creates a jobInfo from a bundle .
//noinspection WrongConstant