Spring Data MongoDB - Core

org.springframework.data.mongodb.core.index
Class IndexField

java.lang.Object
  extended by org.springframework.data.mongodb.core.index.IndexField

public final class IndexField
extends Object

Value object for an index field.

Author:
Oliver Gierke

Method Summary
static IndexField create(String key, Order order)
          Deprecated. use #create(String, Direction).
static IndexField create(String key, Sort.Direction order)
           
 boolean equals(Object obj)
           
static IndexField geo(String key)
          Creates a geo IndexField for the given key.
 Sort.Direction getDirection()
          Returns the direction of the IndexField or null in case we have a geo index field.
 String getKey()
           
 Order getOrder()
          Deprecated. use getDirection() instead.
 int hashCode()
           
 boolean isGeo()
          Returns whether the IndexField is a geo index field.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

create

@Deprecated
public static IndexField create(String key,
                                           Order order)
Deprecated. use #create(String, Direction).

Creates a default IndexField with the given key and Order.

Parameters:
key - must not be null or emtpy.
direction - must not be null.
Returns:

create

public static IndexField create(String key,
                                Sort.Direction order)

geo

public static IndexField geo(String key)
Creates a geo IndexField for the given key.

Parameters:
key - must not be null or empty.
Returns:

getKey

public String getKey()
Returns:
the key

getOrder

@Deprecated
public Order getOrder()
Deprecated. use getDirection() instead.

Returns the direction of the IndexField or null in case we have a geo index field.

Returns:
the direction

getDirection

public Sort.Direction getDirection()
Returns the direction of the IndexField or null in case we have a geo index field.

Returns:
the direction

isGeo

public boolean isGeo()
Returns whether the IndexField is a geo index field.

Returns:
the isGeo

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

Spring Data MongoDB - Core

Copyright © 2011-2014–2014 Pivotal Software, Inc.. All rights reserved.