commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r785316 - /commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/NoOp.java
Date Tue, 16 Jun 2009 17:37:09 GMT
Author: mbenson
Date: Tue Jun 16 17:37:08 2009
New Revision: 785316

URL: http://svn.apache.org/viewvc?rev=785316&view=rev
Log:
add convenience static methods for typesafe NoOps

Modified:
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/NoOp.java

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/NoOp.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/NoOp.java?rev=785316&r1=785315&r2=785316&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/NoOp.java
(original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/NoOp.java
Tue Jun 16 17:37:08 2009
@@ -98,4 +98,24 @@
         return INSTANCE;
     }
 
+    /**
+     * Get a typed NoOp {@link UnaryProcedure}.
+     * @param <A> type
+     * @return <code>UnaryProcedure&lt;A&gt;</code>
+     */
+    @SuppressWarnings("unchecked")
+    public static <A> UnaryProcedure<A> unaryInstance() {
+        return (UnaryProcedure<A>) INSTANCE;
+    }
+
+    /**
+     * Get a typed NoOp {@link BinaryProcedure}.
+     * @param <L> left type
+     * @param <R> right type
+     * @return <code>BinaryProcedure&lt;L, R&gt;</code>
+     */
+    @SuppressWarnings("unchecked")
+    public static <L, R> BinaryProcedure<L, R> binaryInstance() {
+        return (BinaryProcedure<L, R>) INSTANCE;
+    }
 }



Mime
View raw message