org.mule.config
Class PreferredObjectSelector<T>
java.lang.Object
org.mule.config.PreferredObjectSelector<T>
public class PreferredObjectSelector<T>
- extends Object
Selects a preferred object from a collection of instances of the same type
based on the weight of the Preferred
annotation. If there is no
preferred instances, then it just returns the first object in the collection.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PreferredObjectSelector
public PreferredObjectSelector()
select
public T select(Iterator<T> iterator)
- Selects a preferred object from instances returned by an
Iterator
.
The preferred instance will be the instance annotated with Preferred
annotation with the highest weight attribute if there is any, or a non
annotated class otherwise.
- Parameters:
iterator
- contains the objects to select from
- Returns:
- the preferred instance
Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.