forked from projectlombok/lombok
/
README
69 lines (51 loc) · 1.55 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
This is fork of projectlombok for experiments.
Operator Overloading:
branch operatorOverloading
Implementation of (Scala-like) Operator Overloading for Java language.
Works with javac and Eclipse IDE.
Works partially with Netbeans on maven based projects.
Example (See also: ./usage_examples/OperatorOverload_post.jpage):
import java.math.BigInteger;
public class Test {
public static void main(String[] args) {
BigInteger a = BigInteger.valueOf(1),
b = BigInteger.valueOf(2),
c = a + b*a;
System.out.println(c);
}
}
Here `a+b*a` will be transformed to `a.add(b.multiply(a))`.
Map operator to method:
binary:
"+" - "add",
"-" - "subtract",
"*" - "multiply",
"/" - "divide",
"%" - "remainder",
"&" - "and",
"|" - "or",
"^" - "xor",
"<<" - "shiftLeft",
">>" - "shiftRight"
unary:
"-" - "negate"
"~" - "not"
compare:
"<","<=",">",">=" - "compareTo"
These methods exists in many java classes (ex:BigInteger) so you can
use operators on them "out of the box".
Methods inlining:
branch inline
outdated
Original README:
projectlombok makes java a spicier language by adding 'handlers' that know how to build and compile simple, boilerplate-free, not-quite-java code.
See LICENSE for the project lombok license.
To start, run:
ant -projecthelp
HINT: If you'd like to develop lombok in eclipse, run 'ant eclipse' first. It creates the necessary project infrastructure and downloads dependencies.
Project Authors:
Reinier Zwitserloot
twitter: @surial
home: http://zwitserloot.com/
Roel Spilker
twitter: @rspilker