Package dev.morphia.geo
Enum GeoJsonType
- java.lang.Object
-
- java.lang.Enum<GeoJsonType>
-
- dev.morphia.geo.GeoJsonType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<GeoJsonType>
public enum GeoJsonType extends java.lang.Enum<GeoJsonType>
Enumerates all the GeoJson types that are currently supported by Morphia.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description LINE_STRING
MULTI_LINE_STRING
MULTI_POINT
MULTI_POLYGON
POINT
POLYGON
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Geometry
createGeometry(java.util.List<?> geometries)
static GeoJsonType
fromString(java.lang.String type)
Allows you to turn String values of types into the Enum that corresponds to this type.java.lang.String
getType()
Returns the value that needs to be stored with the GeoJson values in the database to declare which GeoJson type the coordinates represent.java.lang.Class<? extends Geometry>
getTypeClass()
Returns a concrete class that implements Geometry, the class that represents this GeoJsonType.static GeoJsonType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static GeoJsonType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
POINT
public static final GeoJsonType POINT
-
LINE_STRING
public static final GeoJsonType LINE_STRING
-
POLYGON
public static final GeoJsonType POLYGON
-
MULTI_POINT
public static final GeoJsonType MULTI_POINT
-
MULTI_LINE_STRING
public static final GeoJsonType MULTI_LINE_STRING
-
MULTI_POLYGON
public static final GeoJsonType MULTI_POLYGON
-
-
Method Detail
-
values
public static GeoJsonType[] 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 (GeoJsonType c : GeoJsonType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static GeoJsonType valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
fromString
public static GeoJsonType fromString(java.lang.String type)
Allows you to turn String values of types into the Enum that corresponds to this type.- Parameters:
type
- a String, one of the values from this list of supported types- Returns:
- the GeoJsonType that corresponds to this type String
-
getType
public java.lang.String getType()
Returns the value that needs to be stored with the GeoJson values in the database to declare which GeoJson type the coordinates represent. See the documentation for a list of the GeoJson objects supported by MongoDB.- Returns:
- a String of the GeoJson type.
-
getTypeClass
public java.lang.Class<? extends Geometry> getTypeClass()
Returns a concrete class that implements Geometry, the class that represents this GeoJsonType.- Returns:
- the Geometry class for this GeoJsonType
-
createGeometry
public abstract Geometry createGeometry(java.util.List<?> geometries)
-
-