urbanairship-core/src/main/java/com/urbanairship/location/LocationRequestOptions.java
public static LocationRequestOptions parseJson(String json) throws JsonException {
        JsonMap jsonMap = JsonValue.parseString(json).getMap();

        if (jsonMap == null) {
            return null;
        }

        Number minDistanceNumber = jsonMap.opt(MIN_DISTANCE_KEY).getNumber();

        float minDistance = minDistanceNumber == null ? DEFAULT_UPDATE_INTERVAL_METERS : minDistanceNumber.floatValue();
        long minTime = jsonMap.opt(MIN_TIME_KEY).getLong(DEFAULT_UPDATE_INTERVAL_MILLISECONDS);
        int priority = jsonMap.opt(PRIORITY_KEY).getInt(DEFAULT_REQUEST_PRIORITY);

        verifyPriority(priority);
        verifyMinDistance(minDistance);
        verifyMinTime(minTime);

        return new LocationRequestOptions(priority, minTime, minDistance);
    }
/**
     * Creates a LocationRequestOptions from a JSON string.
     * @param json The JSON string.
     * @return A LocationRequestOptions, or null if the JSON is not a valid object.
     * @throws JsonException If the string is unable to be parsed to a {@link JsonValue}.
     */
Creates a LocationRequestOptions from a JSON string.
@param json The JSON string.
@return A LocationRequestOptions, or null if the JSON is not a valid object.
@throws JsonException If the string is unable to be parsed to a  JsonValue.
Creates a LocationRequestOptions from a JSON string . @param json The JSON string . @return A LocationRequestOptions or null if the JSON is not a valid object . @throws JsonException If the string is unable to be parsed to a JsonValue .
public static LocationRequestOptions parseJson(String json) throws JsonException {
        JsonMap jsonMap = JsonValue.parseString(json).getMap();
        if (jsonMap == null) {
            return null;
        }
        Number minDistanceNumber = jsonMap.opt(MIN_DISTANCE_KEY).getNumber();
        float minDistance = minDistanceNumber == null ? DEFAULT_UPDATE_INTERVAL_METERS : minDistanceNumber.floatValue();
        long minTime = jsonMap.opt(MIN_TIME_KEY).getLong(DEFAULT_UPDATE_INTERVAL_MILLISECONDS);
        int priority = jsonMap.opt(PRIORITY_KEY).getInt(DEFAULT_REQUEST_PRIORITY);
        verifyPriority(priority);
        verifyMinDistance(minDistance);
        verifyMinTime(minTime);
        return new LocationRequestOptions(priority, minTime, minDistance);
    }
public static LocationRequestOptions parseJson ( String json ) throws JsonException { JsonMap jsonMap = JsonValue . parseString ( json ) . getMap ( ) ; if ( jsonMap == null ) { return null ; } Number minDistanceNumber = jsonMap . opt ( MIN_DISTANCE_KEY ) . getNumber ( ) ; float minDistance = minDistanceNumber == null ? DEFAULT_UPDATE_INTERVAL_METERS : minDistanceNumber . floatValue ( ) ; long minTime = jsonMap . opt ( MIN_TIME_KEY ) . getLong ( DEFAULT_UPDATE_INTERVAL_MILLISECONDS ) ; int priority = jsonMap . opt ( PRIORITY_KEY ) . getInt ( DEFAULT_REQUEST_PRIORITY ) ; verifyPriority ( priority ) ; verifyMinDistance ( minDistance ) ; verifyMinTime ( minTime ) ; return new LocationRequestOptions ( priority , minTime , minDistance ) ; }
Creates a LocationRequestOptions from a JSON string.
Creates a LocationRequestOptions from a JSON string .