org.hibernate.search.bridge.builtin
Class EnumBridge

java.lang.Object
  extended by org.hibernate.search.bridge.builtin.EnumBridge
All Implemented Interfaces:
AppliedOnTypeAwareBridge, StringBridge, TwoWayStringBridge

public class EnumBridge
extends Object
implements TwoWayStringBridge, AppliedOnTypeAwareBridge

Map an Enum field

Author:
Sylvain Vieujot

Constructor Summary
EnumBridge()
           
 
Method Summary
 String objectToString(Object object)
          Converts the object representation to a string.
 void setAppliedOnType(Class<?> returnType)
          Set the return type of the bridge (the type of the field linked to the bridge).
 Enum<? extends Enum> stringToObject(String stringValue)
          Convert the index string representation to an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumBridge

public EnumBridge()
Method Detail

stringToObject

public Enum<? extends Enum> stringToObject(String stringValue)
Description copied from interface: TwoWayStringBridge
Convert the index string representation to an object.

Specified by:
stringToObject in interface TwoWayStringBridge
Parameters:
stringValue - The index value.
Returns:
Takes the string representation from the Lucene index and transforms it back into the original Object.

objectToString

public String objectToString(Object object)
Description copied from interface: StringBridge
Converts the object representation to a string.

Specified by:
objectToString in interface StringBridge
Parameters:
object - The object to transform into a string representation.
Returns:
String representation of the given object to be stored in Lucene index. The return string must not be null. It can be empty though.

setAppliedOnType

public void setAppliedOnType(Class<?> returnType)
Description copied from interface: AppliedOnTypeAwareBridge
Set the return type of the bridge (the type of the field linked to the bridge).

Specified by:
setAppliedOnType in interface AppliedOnTypeAwareBridge
Parameters:
returnType - return type


Copyright © 2006-2012 Red Hat Middleware, LLC. All Rights Reserved