org.springframework.data.geo.format

## Enum DistanceFormatter

- java.lang.Object
- - java.lang.Enum<DistanceFormatter>
  - - org.springframework.data.geo.format.DistanceFormatter

All Implemented Interfaces:
  Serializable, Comparable<DistanceFormatter>, Converter<String,Distance>, Formatter<Distance>, Parser<Distance>, Printer<Distance>

    public enum DistanceFormatter
    extends Enum<DistanceFormatter>
    implements Converter<String,Distance>, Formatter<Distance>

Converter to create `Distance` instances from `String` representations. The supported format is a decimal followed by whitespace and a metric abbreviation. We currently support the following abbreviations: .

Author:
  Oliver Gierke, Christoph Strobl

### Enum Constant Summary

Enum Constants
Enum Constant and Description
`INSTANCE`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`Distance` `convert(String source)`
`Distance` `parse(String text, Locale locale)`
`String` `print(Distance distance, Locale locale)`
`static DistanceFormatter` `valueOf(String name)` Returns the enum constant of this type with the specified name.
`static DistanceFormatter[]` `values()` Returns an array containing the constants of this enum type, in the order they are declared.

### Methods inherited from class java.lang.Enum

`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.springframework.core.convert.converter.Converter

`andThen`

### Enum Constant Detail

#### INSTANCE

    public static final DistanceFormatter INSTANCE

### Method Detail

#### values

    public static DistanceFormatter[] values()

Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

    for (DistanceFormatter c : DistanceFormatter.values())
        System.out.println(c);

Returns:
  an array containing the constants of this enum type, in the order they are declared

#### valueOf

    public static DistanceFormatter valueOf(String name)

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
  `name` - the name of the enum constant to be returned.
Returns:
  the enum constant with the specified name
Throws:
  `IllegalArgumentException` - if this enum type has no constant with the specified name
  `NullPointerException` - if the argument is null

#### convert

    @Nullable
    public final Distance convert(String source)

Specified by:
  `convert` in interface `Converter<String,Distance>`

#### print

    public String print(Distance distance,
                        Locale locale)

Specified by:
  `print` in interface `Printer<Distance>`

#### parse

    public Distance parse(String text,
                          Locale locale)
                   throws ParseException

Specified by:
  `parse` in interface `Parser<Distance>`
Throws:
  `ParseException`