Spring Data Document

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)
          Creates a default IndexField with the given key and Order.
 boolean equals(Object obj)
           
static IndexField geo(String key)
          Creates a geo IndexField for the given key.
 String getKey()
           
 Order getOrder()
          Returns the order of the IndexField or null in case we have a geo index field.
 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

public static IndexField create(String key,
                                Order order)
Creates a default IndexField with the given key and Order.

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

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

public Order getOrder()
Returns the order of the IndexField or null in case we have a geo index field.

Returns:
the order

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 Document

Copyright © 2012. All Rights Reserved.