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 IndexFieldcreate(String key, Sort.Direction order) booleanstatic IndexFieldCreates a geoIndexFieldfor the given key.Returns the direction of theIndexFieldor null in case we have a geo index field.getKey()inthashCode()booleanisGeo()Returns whether theIndexFieldis a geo index field.booleanisHashed()Returns whether theIndexFieldis a hashed.booleanisText()Returns whether theIndexFieldis a text index field.booleanReturns whether theIndexFieldis contains a wildcard expression.static IndexFieldCreates a textIndexFieldfor the given key.toString()static IndexField
-
Method Details
-
create
-
vector
-
geo
Creates a geoIndexFieldfor the given key.- Parameters:
key- must not be null or empty.- Returns:
- new instance of
IndexField.
-
text
Creates a textIndexFieldfor the given key.- Since:
- 1.6
-
getKey
- Returns:
- the key
-
getDirection
Returns the direction of theIndexFieldor null in case we have a geo index field.- Returns:
- the direction
-
isGeo
public boolean isGeo()Returns whether theIndexFieldis a geo index field.- Returns:
- true if type is
IndexField.Type.GEO.
-
isText
public boolean isText()Returns whether theIndexFieldis a text index field.- Returns:
- true if type is
IndexField.Type.TEXT - Since:
- 1.6
-
isHashed
public boolean isHashed()Returns whether theIndexFieldis a hashed.- Returns:
- true if
IndexFieldis hashed. - Since:
- 2.2
-
isWildcard
public boolean isWildcard()Returns whether theIndexFieldis contains a wildcard expression.- Returns:
- true if
IndexFieldcontains a wildcard $**. - Since:
- 3.3
-
equals
-
hashCode
public int hashCode() -
toString
-