-
Notifications
You must be signed in to change notification settings - Fork 593
/
primitiveToPrimitiveFunction.stg
40 lines (30 loc) · 1.25 KB
/
primitiveToPrimitiveFunction.stg
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
import "copyright.stg"
hasTwoPrimitives() ::= "true"
targetPath() ::= "org/eclipse/collections/api/block/function/primitive"
fileName(primitive1, primitive2, sameTwoPrimitives) ::= "<primitive1.name>To<primitive2.name>Function"
class(primitive1, primitive2, sameTwoPrimitives) ::= <<
<body(primitive1.type, primitive2.type, primitive1.name, primitive2.name)>
>>
body(type1, type2, name1, name2) ::= <<
<copyright()>
package org.eclipse.collections.api.block.function.primitive;
import java.io.Serializable;
/**
* This file was automatically generated from template file primitiveToPrimitiveFunction.stg.
*
* @since 3.0.
*/
<if(primitive1.specializedStream && primitive2.specializedStream)>@FunctionalInterface<endif>
public interface <name1>To<name2>Function
extends <if(primitive1.specializedStream && primitive2.specializedStream && !sameTwoPrimitives)>java.util.function.<name1>To<name2>Function, <elseif(primitive1.specializedStream && sameTwoPrimitives)>java.util.function.<name1>UnaryOperator, <endif>Serializable
{
<type2> valueOf(<type1> <type1>Parameter);
<if(primitive1.specializedStream && primitive2.specializedStream)>
@Override
default <type2> applyAs<name2>(<type1> each)
{
return this.valueOf(each);
}
<endif>
}
>>