net.conquiris.api.search
Class AbstractHitMapper<T>

java.lang.Object
  extended by net.conquiris.api.search.AbstractHitMapper<T>
Type Parameters:
T - Type of the custom object.
All Implemented Interfaces:
com.google.common.base.Function<Hit,T>, HitMapper<T>

public abstract class AbstractHitMapper<T>
extends Object
implements HitMapper<T>

Abstract implementation of a hit mapper.

Author:
Andres Rodriguez

Constructor Summary
protected AbstractHitMapper()
          Constructor with no selector.
protected AbstractHitMapper(org.apache.lucene.document.FieldSelector selector)
          Constructor with a provided selector.
protected AbstractHitMapper(Iterable<String> fieldsToLoad)
          Creates a mapper with a selector that loads only a certain set of fields.
protected AbstractHitMapper(Iterable<String> fieldsToLoad, Iterable<String> fieldsToLoadLazily)
          Creates a mapper with a selector that loads a certain set of fields eagerly, another set lazily and the rest are not loaded.
 
Method Summary
 org.apache.lucene.document.FieldSelector getFieldSelector()
          Returns the field selector to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.common.base.Function
apply, equals
 

Constructor Detail

AbstractHitMapper

protected AbstractHitMapper()
Constructor with no selector.


AbstractHitMapper

protected AbstractHitMapper(@Nullable
                            org.apache.lucene.document.FieldSelector selector)
Constructor with a provided selector.


AbstractHitMapper

protected AbstractHitMapper(Iterable<String> fieldsToLoad,
                            Iterable<String> fieldsToLoadLazily)
Creates a mapper with a selector that loads a certain set of fields eagerly, another set lazily and the rest are not loaded.

Parameters:
fieldsToLoad - Fields to load eagerly.
fieldsToLoadLazily - Fields to load lazily.
Throws:
NullPointerException - if any of the argument or any of their members is null.

AbstractHitMapper

protected AbstractHitMapper(Iterable<String> fieldsToLoad)
Creates a mapper with a selector that loads only a certain set of fields.

Parameters:
fieldsToLoad - Fields to load.
Throws:
NullPointerException - if the argument or any of its members is null.
Method Detail

getFieldSelector

public final org.apache.lucene.document.FieldSelector getFieldSelector()
Description copied from interface: HitMapper
Returns the field selector to use.

Specified by:
getFieldSelector in interface HitMapper<T>
Returns:
The field selector or null if no selector is used.


Copyright © 2012 Derquinse Projects.. All Rights Reserved.