Skip to content

Commit 6d1585e

Browse files
committed
style: Format Arity.
1 parent e1d8222 commit 6d1585e

1 file changed

Lines changed: 21 additions & 21 deletions

File tree

  • src/main/java/cz/jirutka/rsql/parser/ast

src/main/java/cz/jirutka/rsql/parser/ast/Arity.java

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,27 @@
3030
*/
3131
public interface Arity {
3232

33+
/**
34+
* Creates arity with given {@code min} and {@code max}.
35+
*
36+
* @param min The minimum number of arguments. Must be zero or positive.
37+
* @param max The maximum number of arguments. Must be zero or positive and greater than or equal to {@code min}.
38+
* @return the created arity
39+
*/
40+
static Arity of(int min, int max) {
41+
return min == max ? nary(min) : new DynamicArity(min, max);
42+
}
43+
44+
/**
45+
* Creates N-ary object.
46+
*
47+
* @param n The N.
48+
* @return the created arity
49+
*/
50+
static Arity nary(int n) {
51+
return new NAry(n);
52+
}
53+
3354
/**
3455
* The minimum number of arguments operator can receive.
3556
*
@@ -65,25 +86,4 @@ public interface Arity {
6586
*/
6687
@Override
6788
int hashCode();
68-
69-
/**
70-
* Creates arity with given {@code min} and {@code max}.
71-
*
72-
* @param min The minimum number of arguments. Must be zero or positive.
73-
* @param max The maximum number of arguments. Must be zero or positive and greater than or equal to {@code min}.
74-
* @return the created arity
75-
*/
76-
static Arity of(int min, int max) {
77-
return min == max ? nary(min) : new DynamicArity(min, max);
78-
}
79-
80-
/**
81-
* Creates N-ary object.
82-
*
83-
* @param n The N.
84-
* @return the created arity
85-
*/
86-
static Arity nary(int n) {
87-
return new NAry(n);
88-
}
8989
}

0 commit comments

Comments
 (0)