-
Notifications
You must be signed in to change notification settings - Fork 590
/
primitiveFunction.stg
40 lines (31 loc) · 1.04 KB
/
primitiveFunction.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"
targetPath() ::= "org/eclipse/collections/api/block/function/primitive"
fileName(primitive) ::= "<primitive.name>Function"
class(primitive) ::= <<
<body(primitive.type, primitive.name, primitive.wrapperName)>
>>
body(type, name, wrapperName) ::= <<
<copyright()>
package org.eclipse.collections.api.block.function.primitive;
import java.io.Serializable;
/**
* <name>Function is a primitive Function which may be used to reduce the overhead
* of autoboxing <wrapperName> objects in places where primitive <type>s could be used.
* This file was automatically generated from template file primitiveFunction.stg.
*
* @since 3.0.
*/
<if(primitive.specializedStream)>@FunctionalInterface<endif>
public interface <name>Function\<T>
extends <if(primitive.specializedStream)>java.util.function.To<name>Function\<T>, <endif>Serializable
{
<type> <type>ValueOf(T anObject);
<if(primitive.specializedStream)>
@Override
default <type> applyAs<name>(T value)
{
return this.<type>ValueOf(value);
}
<endif>
}
>>