-
Notifications
You must be signed in to change notification settings - Fork 587
/
objectPrimitiveMap.stg
114 lines (85 loc) · 2.92 KB
/
objectPrimitiveMap.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
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import "copyrightAndOthers.stg"
targetPath() ::= "org/eclipse/collections/api/map/primitive"
fileName(primitive) ::= "Object<primitive.name>Map"
class(primitive) ::= <<
<body(primitive.type, primitive.name)>
>>
body(type, name) ::= <<
<copyrightAndOthers()>
package org.eclipse.collections.api.map.primitive;
import java.util.Set;
import org.eclipse.collections.api.<name>Iterable;
import org.eclipse.collections.api.LazyIterable;
import org.eclipse.collections.api.RichIterable;
import org.eclipse.collections.api.block.predicate.primitive.Object<name>Predicate;
import org.eclipse.collections.api.block.procedure.Procedure;
import org.eclipse.collections.api.block.procedure.primitive.Object<name>Procedure;
import org.eclipse.collections.api.block.procedure.primitive.<name>Procedure;
import org.eclipse.collections.api.collection.primitive.Mutable<name>Collection;
import org.eclipse.collections.api.tuple.primitive.Object<name>Pair;
/**
* This file was automatically generated from template file objectPrimitiveMap.stg.
*
* @since 3.0.
*/
public interface Object<name>Map\<K> extends <name>Iterable
{
<type> get(Object key);
<type> getOrThrow(Object key);
<type> getIfAbsent(Object key, <type> ifAbsent);
boolean containsKey(Object key);
boolean containsValue(<type> value);
void forEachValue(<name>Procedure procedure);
void forEachKey(Procedure\<? super K> procedure);
void forEachKeyValue(Object<name>Procedure\<? super K> procedure);
<if(!primitive.booleanPrimitive)><(flipUniqueValues.(name))(name)><endif>
Object<name>Map\<K> select(Object<name>Predicate\<? super K> predicate);
Object<name>Map\<K> reject(Object<name>Predicate\<? super K> predicate);
/**
* @since 9.0.
*/
default Object<name>Map\<K> tap(<name>Procedure procedure)
{
this.forEach(procedure);
return this;
}
/**
* Follows the same general contract as {@link java.util.AbstractMap#toString()}
*
* @return a string representation of this Object<name>Map
*/
String toString();
ImmutableObject<name>Map\<K> toImmutable();
Set\<K> keySet();
Mutable<name>Collection values();
/**
* @since 5.0
*/
LazyIterable\<K> keysView();
/**
* @since 5.0
*/
RichIterable\<Object<name>Pair\<K>\> keyValuesView();
}
>>
flipUniqueValues ::= [
"Byte": "flipUniqueValues",
"Short": "flipUniqueValues",
"Char": "flipUniqueValues",
"Int": "flipUniqueValues",
"Long": "flipUniqueValues",
"Float": "flipUniqueValues",
"Double": "flipUniqueValues",
"Boolean": "noMethods"
]
noMethods(name) ::= ""
flipUniqueValues(name) ::= <<
/**
* Return the <name>ObjectMap that is obtained by flipping the direction of this map and making the associations
* from value to key.
*
* @throws IllegalStateException if the <name>ObjectMap contains duplicate values.
* @since 9.0
*/
<name>ObjectMap\<K> flipUniqueValues();
>>