org.apache.commons.collections4.Factory Java Examples

The following examples show how to use org.apache.commons.collections4.Factory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ExecutableExpressionTree.java    From DataHubSystem with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Creates a constant leave from a Factory.
 * @param <T> Type of the Collection entry.
 * @param <R> Return type.
 * @param p a Provider.
 * @return a new Node.
 */
public static <T,R> Node<T,R> createLeave(final Factory<R> p)
{
   return new Node<T,R>()
   {
      @Override
      public R exec(T element)
      {
         return p.create();
      }
   };
}
 
Example #2
Source File: UserFormEditForm.java    From openemm with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void reset(ActionMapping map, HttpServletRequest request) {
    super.reset(map, request);
    Factory<String> factory = () -> Integer.toString(0);
    columnwidthsList = LazyList.lazyList(new ArrayList<>(), factory);
}