Re: toString() in index

22 views
Skip to first unread message

Mario Fusco

unread,
Apr 4, 2013, 2:37:22 AM4/4/13
to lambdaj
This is a well known and well documented limitation of lambdaj: you cannot further reference a final class like Long because it is not proxable.
The 2 available solutions are:

1. add a getAdministratorIdAsString() to the Administrator class
2. write your own Converter and pass it to the index method

Mario


On Wed, Apr 3, 2013 at 11:43 PM, Val Valtor <vac...@yahoo.ca> wrote:
Hello,

I decided to try using LambdaJ on my project and ran into a problem on the very first attempt.

I have a list:

     List<Administrator> allAdmins;

and I need to index it into this map:

     Map<String, Administrator> adminIdToAdmin = new HashMap<String, Administrator>();

I attempted to do this with the following:

     adminIdToAdmin = index(allAdmins, on(Administrator.class).getAdministratorId().toString()) ;

And I get 
    ch.lambdaj.function.argument.ArgumentConversionException: Unable to convert the placeholder -2147483647 in a valid argument

The problem appears to be that getAdministratorId() returns a Long, whereas I want it to become a String in the map, and LambdaJ does not support chaining methods like I did with .toString() there.


Can anyone recommend a solution?


Thanks!

--
 
---
You received this message because you are subscribed to the Google Groups "lambdaj" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lambdaj+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages