Class IndexField
java.lang.Object
org.springframework.data.mongodb.core.index.IndexField
Value object for an index field.
- Author:
- Oliver Gierke, Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptionstatic IndexField
create
(String key, Sort.Direction order) boolean
static IndexField
Creates a geoIndexField
for the given key.Returns the direction of theIndexField
or null in case we have a geo index field.getKey()
int
hashCode()
boolean
isGeo()
Returns whether theIndexField
is a geo index field.boolean
isHashed()
Returns whether theIndexField
is a hashed.boolean
isText()
Returns whether theIndexField
is a text index field.boolean
Returns whether theIndexField
is contains a wildcard expression.static IndexField
Creates a textIndexField
for the given key.toString()
-
Method Details
-
create
-
geo
Creates a geoIndexField
for the given key.- Parameters:
key
- must not be null or empty.- Returns:
- new instance of
IndexField
.
-
text
Creates a textIndexField
for the given key.- Since:
- 1.6
-
getKey
- Returns:
- the key
-
getDirection
Returns the direction of theIndexField
or null in case we have a geo index field.- Returns:
- the direction
-
isGeo
public boolean isGeo()Returns whether theIndexField
is a geo index field.- Returns:
- true if type is
IndexField.Type.GEO
.
-
isText
public boolean isText()Returns whether theIndexField
is a text index field.- Returns:
- true if type is
IndexField.Type.TEXT
- Since:
- 1.6
-
isHashed
public boolean isHashed()Returns whether theIndexField
is a hashed.- Returns:
- true if
IndexField
is hashed. - Since:
- 2.2
-
isWildcard
public boolean isWildcard()Returns whether theIndexField
is contains a wildcard expression.- Returns:
- true if
IndexField
contains a wildcard $**. - Since:
- 3.3
-
equals
-
hashCode
public int hashCode() -
toString
-