Author: shane.bryzak(a)jboss.com
Date: 2010-07-05 20:08:38 -0400 (Mon, 05 Jul 2010)
New Revision: 6584
Modified:
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/properties/query/PropertyQuery.java
Log:
add getFirstResult() method
Modified:
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/properties/query/PropertyQuery.java
===================================================================
---
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/properties/query/PropertyQuery.java 2010-06-30
19:28:34 UTC (rev 6583)
+++
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/properties/query/PropertyQuery.java 2010-07-06
00:08:38 UTC (rev 6584)
@@ -39,6 +39,12 @@
return this;
}
+ public Property<V> getFirstResult()
+ {
+ List<Property<V>> results = getResultList();
+ return results.isEmpty() ? null : results.get(0);
+ }
+
public List<Property<V>> getResultList()
{
List<Property<V>> results = new ArrayList<Property<V>>();