You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Max Tardiveau (JIRA)" <ji...@apache.org> on 2011/07/31 13:59:09 UTC
[jira] [Created] (JEXL-118) Provide an IN operator
Provide an IN operator
----------------------
Key: JEXL-118
URL: https://issues.apache.org/jira/browse/JEXL-118
Project: Commons JEXL
Issue Type: New Feature
Affects Versions: 2.0.1
Reporter: Max Tardiveau
It would be very useful to have an IN operator, e.g.:
status in ['A', 'B', 'C']
This can currently be done with :
status == 'A' or status == 'B' or status == 'C'
but (especially for longer lists) the IN operator would be more concise and more elegant.
Extra bonus points, of course, if this works with variables, e.g.:
status in possibleStatuses
where possibleStatuses would be an object of type Collection.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (JEXL-118) Provide an IN operator
Posted by "Henri Biestro (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JEXL-118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henri Biestro resolved JEXL-118.
--------------------------------
Resolution: Fixed
Fix Version/s: 2.1
Instead of a new IN operator, I extended =~ and !~ operators to behave as IN and NOT IN on sets, collections, maps (on keys), arrays and "duck-typed" collections (classes exposing "contains" method).
Works with constants and variables (extra points :-)).
Committed revision 1153476.
trunk/src/main/java/org/apache/commons/jexl2/Interpreter.java
trunk/src/main/java/org/apache/commons/jexl2/JexlArithmetic.java
trunk/src/main/java/org/apache/commons/jexl2/internal/ArrayListWrapper.java
trunk/src/site/xdoc/changes.xml
trunk/src/site/xdoc/reference/syntax.xml
trunk/src/test/java/org/apache/commons/jexl2/ArithmeticTest.java
> Provide an IN operator
> ----------------------
>
> Key: JEXL-118
> URL: https://issues.apache.org/jira/browse/JEXL-118
> Project: Commons JEXL
> Issue Type: New Feature
> Affects Versions: 2.0.1
> Reporter: Max Tardiveau
> Assignee: Henri Biestro
> Labels: features
> Fix For: 2.1
>
>
> It would be very useful to have an IN operator, e.g.:
> status in ['A', 'B', 'C']
> that would return a boolean. This can currently be done with :
> status == 'A' or status == 'B' or status == 'C'
> but (especially for longer lists) the IN operator would be more concise and more elegant.
> Extra bonus points, of course, if this works with variables, e.g.:
> status in possibleStatuses
> where possibleStatuses would be an object of type Collection.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (JEXL-118) Provide an IN operator
Posted by "Max Tardiveau (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JEXL-118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Max Tardiveau updated JEXL-118:
-------------------------------
Description:
It would be very useful to have an IN operator, e.g.:
status in ['A', 'B', 'C']
that would return a boolean. This can currently be done with :
status == 'A' or status == 'B' or status == 'C'
but (especially for longer lists) the IN operator would be more concise and more elegant.
Extra bonus points, of course, if this works with variables, e.g.:
status in possibleStatuses
where possibleStatuses would be an object of type Collection.
was:
It would be very useful to have an IN operator, e.g.:
status in ['A', 'B', 'C']
This can currently be done with :
status == 'A' or status == 'B' or status == 'C'
but (especially for longer lists) the IN operator would be more concise and more elegant.
Extra bonus points, of course, if this works with variables, e.g.:
status in possibleStatuses
where possibleStatuses would be an object of type Collection.
> Provide an IN operator
> ----------------------
>
> Key: JEXL-118
> URL: https://issues.apache.org/jira/browse/JEXL-118
> Project: Commons JEXL
> Issue Type: New Feature
> Affects Versions: 2.0.1
> Reporter: Max Tardiveau
> Labels: features
>
> It would be very useful to have an IN operator, e.g.:
> status in ['A', 'B', 'C']
> that would return a boolean. This can currently be done with :
> status == 'A' or status == 'B' or status == 'C'
> but (especially for longer lists) the IN operator would be more concise and more elegant.
> Extra bonus points, of course, if this works with variables, e.g.:
> status in possibleStatuses
> where possibleStatuses would be an object of type Collection.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (JEXL-118) Provide an IN operator
Posted by "Sebb (Closed) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JEXL-118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sebb closed JEXL-118.
---------------------
> Provide an IN operator
> ----------------------
>
> Key: JEXL-118
> URL: https://issues.apache.org/jira/browse/JEXL-118
> Project: Commons JEXL
> Issue Type: New Feature
> Affects Versions: 2.0.1
> Reporter: Max Tardiveau
> Assignee: Henri Biestro
> Labels: features
> Fix For: 2.1
>
>
> It would be very useful to have an IN operator, e.g.:
> status in ['A', 'B', 'C']
> that would return a boolean. This can currently be done with :
> status == 'A' or status == 'B' or status == 'C'
> but (especially for longer lists) the IN operator would be more concise and more elegant.
> Extra bonus points, of course, if this works with variables, e.g.:
> status in possibleStatuses
> where possibleStatuses would be an object of type Collection.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (JEXL-118) Provide an IN operator
Posted by "Max Tardiveau (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JEXL-118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13078784#comment-13078784 ]
Max Tardiveau commented on JEXL-118:
------------------------------------
Awesome! Thanks a bunch, this is going to be pretty handy.
In case you're wondering what we're doing with this, by the way:
http://www.automatedbusinesslogic.com/
We use Jexl to do runtime interpretation of formulas, constraints, and clauses for sums and counts.
Thanks again!
> Provide an IN operator
> ----------------------
>
> Key: JEXL-118
> URL: https://issues.apache.org/jira/browse/JEXL-118
> Project: Commons JEXL
> Issue Type: New Feature
> Affects Versions: 2.0.1
> Reporter: Max Tardiveau
> Assignee: Henri Biestro
> Labels: features
> Fix For: 2.1
>
>
> It would be very useful to have an IN operator, e.g.:
> status in ['A', 'B', 'C']
> that would return a boolean. This can currently be done with :
> status == 'A' or status == 'B' or status == 'C'
> but (especially for longer lists) the IN operator would be more concise and more elegant.
> Extra bonus points, of course, if this works with variables, e.g.:
> status in possibleStatuses
> where possibleStatuses would be an object of type Collection.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira