forked from rethinkdb/rethinkdb-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBinary.java
More file actions
39 lines (35 loc) · 1.01 KB
/
Binary.java
File metadata and controls
39 lines (35 loc) · 1.01 KB
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
<%inherit file="../AstSubclass.java"/>
<%block name="add_imports">
import com.rethinkdb.utils.Internals;
import org.jetbrains.annotations.Nullable;
</%block>
<%block name="member_vars">
public @Nullable byte[] binaryData;
</%block>
<%block name="constructors">
public ${classname}(byte[] bytes) {
this(new Arguments());
binaryData = bytes;
}
public ${classname}(Object arg) {
this(new Arguments(arg), null);
}
public ${classname}(Arguments args) {
this(args, null);
}
public ${classname}(Arguments args, OptArgs optargs) {
this(TermType.${term_name}, args, optargs);
}
protected ${classname}(TermType termType, Arguments args, OptArgs optargs) {
super(termType, args, optargs);
}</%block>
<%block name="special_methods">
@Override
public Object build(){
if (binaryData != null) {
return Internals.asBinaryPseudotype(binaryData);
} else {
return super.build();
}
}
</%block>