[hibernate-commits] Hibernate SVN: r15574 - in search/trunk/src/java/org/hibernate/search/bridge: builtin and 1 other directory.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Mon Nov 17 06:23:26 EST 2008


Author: hardy.ferentschik
Date: 2008-11-17 06:23:26 -0500 (Mon, 17 Nov 2008)
New Revision: 15574

Modified:
   search/trunk/src/java/org/hibernate/search/bridge/StringBridge.java
   search/trunk/src/java/org/hibernate/search/bridge/TwoWayStringBridge.java
   search/trunk/src/java/org/hibernate/search/bridge/builtin/BigIntegerBridge.java
Log:
javadoc fixes

Modified: search/trunk/src/java/org/hibernate/search/bridge/StringBridge.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/bridge/StringBridge.java	2008-11-17 10:32:38 UTC (rev 15573)
+++ search/trunk/src/java/org/hibernate/search/bridge/StringBridge.java	2008-11-17 11:23:26 UTC (rev 15574)
@@ -4,8 +4,8 @@
 /**
  * Transform an object into a string representation.
  * 
- * All implementations are required to be threadsafe;
- * usually this is easily achieved avoiding the usage
+ * All implementations are required to be threadsafe.
+ * Usually this is easily achieved avoiding the usage
  * of class fields, unless they are either immutable
  * or needed to store parameters.
  *
@@ -14,7 +14,11 @@
 public interface StringBridge {
 	
 	/**
-	 * {@inheritDoc}
+	 * Converts the object representation to a string.
+	 *
+	 * @param object The object to transform into a string representation.
+	 * @return String representation of the given object to be stored in Lucene index. The return string must not be
+	 * <code>null</code>. It can be empty though.
 	 */
 	String objectToString(Object object);
 }

Modified: search/trunk/src/java/org/hibernate/search/bridge/TwoWayStringBridge.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/bridge/TwoWayStringBridge.java	2008-11-17 10:32:38 UTC (rev 15573)
+++ search/trunk/src/java/org/hibernate/search/bridge/TwoWayStringBridge.java	2008-11-17 11:23:26 UTC (rev 15574)
@@ -2,21 +2,26 @@
 package org.hibernate.search.bridge;
 
 /**
- * StringBridge allowing a translation from the String back to the Object
- * objectToString( stringToObject( string ) ) and stringToObject( objectToString( object ) )
- * should be "idempotent". More precisely,
- *
- * objectToString( stringToObject( string ) ).equals(string) for string not null
- * stringToObject( objectToString( object ) ).equals(object) for object not null 
+ * <code>StringBridge<code> allowing a translation from the string representation back to the <code>Object</code>.
+ * <code>objectToString( stringToObject( string ) )</code> and <code>stringToObject( objectToString( object ) )</code>
+ * should be "idempotent". More precisely:
+ * <ul>
+ * <li><code>objectToString( stringToObject( string ) ).equals(string)</code>, for non <code>null</code> string.</li>
+ * <li><code>stringToObject( objectToString( object ) ).equals(object)</code>, for non <code>null</code> object. </li>
+ * </ul>
  * 
- * As for all Bridges implementors must be threasafe.
+ * As for all Bridges implementations must be threasafe.
  * 
  * @author Emmanuel Bernard
  */
 public interface TwoWayStringBridge extends StringBridge {
 
 	/**
-	 * {@inheritDoc}
+	 * Convert the index string representation to an object.
+	 *
+	 * @param stringValue The index value.
+	 * @return Takes the string representation from the Lucene index and transforms it back into the original
+	 * <code>Object</code>.
 	 */
 	Object stringToObject(String stringValue);
 }

Modified: search/trunk/src/java/org/hibernate/search/bridge/builtin/BigIntegerBridge.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/bridge/builtin/BigIntegerBridge.java	2008-11-17 10:32:38 UTC (rev 15573)
+++ search/trunk/src/java/org/hibernate/search/bridge/builtin/BigIntegerBridge.java	2008-11-17 11:23:26 UTC (rev 15574)
@@ -6,13 +6,15 @@
 import org.hibernate.util.StringHelper;
 
 /**
- * Map a BigInteger element
+ * Map a <code>BigInteger</code> element.
  *
  * @author Emmanuel Bernard
  */
 public class BigIntegerBridge extends NumberBridge {
 	public Object stringToObject(String stringValue) {
-		if ( StringHelper.isEmpty( stringValue ) ) return null;
+		if ( StringHelper.isEmpty( stringValue ) ) {
+			return null;
+		}
 		return new BigInteger( stringValue );
 	}
 }




More information about the hibernate-commits mailing list