Search code examples
javafunctional-programminglambdaj

Is asList Function Part of Lamdaj library


I'm trying to understand lambdaj library in order to use functional style programming in java. Their wiki page example uses a function called asList which I don't see in any of the lambda packages.

I'm using lambdaj 2.4 version and I'm referring to https://code.google.com/p/lambdaj/wiki/LambdajFeatures

Am I missing anything here ? Is it a function that is assumed to be written by the users of the library?


Solution

  • The asList() function is in the java.util.Arrays class. It acts as bridge between array-based and collection-based APIs.

    If you don't want to clutter the code with qualifier references (i.e. "Arrays.") you can import the method via a static import import static java.util.Arrays.asList;