@JsonCreator
    public static GeoDistance parse(String json) {
        try {
            String unit = null;
            for (GeoDistanceUnit geoDistanceUnit : GeoDistanceUnit.values()) {
                for (String name : geoDistanceUnit.getNames()) {
                    if (json.endsWith(name) && (unit == null || unit.length() < name.length())) {
                        unit = name;
                    }
                }
            }
            if (unit != null) {
                double value = Double.parseDouble(json.substring(0, json.indexOf(unit)));
                return new GeoDistance(value, GeoDistanceUnit.create(unit));
            }
            double value = Double.parseDouble(json);
            return new GeoDistance(value, GeoDistanceUnit.METRES);
        } catch (Exception e) {
            throw new IndexException(e, "Unparseable distance: {}", json);
        }
    }
@ JsonCreator public static GeoDistance parse ( String json ) { try { String unit = null ; for ( GeoDistanceUnit geoDistanceUnit : GeoDistanceUnit . values ( ) ) { for ( String name : geoDistanceUnit . getNames ( ) ) { if ( json . endsWith ( name ) && ( unit == null || unit . length ( ) < name . length ( ) ) ) { unit = name ; } } } if ( unit != null ) { double value = Double . parseDouble ( json . substring ( 0 , json . indexOf ( unit ) ) ) ; return new GeoDistance ( value , GeoDistanceUnit . create ( unit ) ) ; } double value = Double . parseDouble ( json ) ; return new GeoDistance ( value , GeoDistanceUnit . METRES ) ; } catch ( Exception e ) { throw new IndexException ( e , "Unparseable distance: {}" , json ) ; } }
Returns the {@link GeoDistance} represented by the specified JSON {@code String}.

@param json A {@code String} containing a JSON encoded {@link GeoDistance}.
@return The {@link GeoDistance} represented by the specified JSON {@code String}.