35
35
* @param <E>
36
36
* the type of elements maintained by the created set or keys by the created map.
37
37
*/
38
- public class EqualityTransformingBuilder <E > {
38
+ public class EqualityTransformingCollectionBuilder <E > {
39
39
40
40
private final Class <? super E > outerKeyTypeToken ;
41
41
private BiPredicate <? super E , ? super E > equals ;
42
42
private ToIntFunction <? super E > hash ;
43
43
44
- private EqualityTransformingBuilder (Class <? super E > outerKeyTypeToken ) {
44
+ private EqualityTransformingCollectionBuilder (Class <? super E > outerKeyTypeToken ) {
45
45
this .outerKeyTypeToken = outerKeyTypeToken ;
46
46
// note that the methods from 'Objects' already implement the contract for null-safety
47
47
// imposed by the transforming set and map
@@ -65,8 +65,8 @@ private EqualityTransformingBuilder(Class<? super E> outerKeyTypeToken) {
65
65
* the type of elements contained in the set created by the builder
66
66
* @return a new builder
67
67
*/
68
- public static <E > EqualityTransformingBuilder <E > forUnspecifiedKeyType () {
69
- return new EqualityTransformingBuilder <>(Object .class );
68
+ public static <E > EqualityTransformingCollectionBuilder <E > forUnspecifiedKeyType () {
69
+ return new EqualityTransformingCollectionBuilder <>(Object .class );
70
70
}
71
71
72
72
/**
@@ -80,17 +80,17 @@ public static <E> EqualityTransformingBuilder<E> forUnspecifiedKeyType() {
80
80
* a type token for the elements contained in the set created by the builder
81
81
* @return a new builder
82
82
*/
83
- public static <E > EqualityTransformingBuilder <E > forKeyType (Class <? super E > keyTypeToken ) {
83
+ public static <E > EqualityTransformingCollectionBuilder <E > forKeyType (Class <? super E > keyTypeToken ) {
84
84
Objects .requireNonNull (keyTypeToken , "The argument 'keyTypeToken' must not be null." );
85
- return new EqualityTransformingBuilder <>(keyTypeToken );
85
+ return new EqualityTransformingCollectionBuilder <>(keyTypeToken );
86
86
}
87
87
88
88
/**
89
89
* @param equals
90
90
* a function determining equality of keys; might be called with null keys
91
91
* @return this builder
92
92
*/
93
- public EqualityTransformingBuilder <E > withEqualsHandlingNull (BiPredicate <? super E , ? super E > equals ) {
93
+ public EqualityTransformingCollectionBuilder <E > withEqualsHandlingNull (BiPredicate <? super E , ? super E > equals ) {
94
94
Objects .requireNonNull (equals , "The argument 'equals' must not be null." );
95
95
this .equals = equals ;
96
96
return this ;
@@ -101,7 +101,7 @@ public EqualityTransformingBuilder<E> withEqualsHandlingNull(BiPredicate<? super
101
101
* a function determining equality of keys; will not be called with null keys
102
102
* @return this builder
103
103
*/
104
- public EqualityTransformingBuilder <E > withEquals (BiPredicate <? super E , ? super E > equals ) {
104
+ public EqualityTransformingCollectionBuilder <E > withEquals (BiPredicate <? super E , ? super E > equals ) {
105
105
Objects .requireNonNull (equals , "The argument 'equals' must not be null." );
106
106
return withEqualsHandlingNull (makeNullSafe (equals ));
107
107
}
@@ -122,7 +122,7 @@ public EqualityTransformingBuilder<E> withEquals(BiPredicate<? super E, ? super
122
122
* a function computing the hash code of a key; might be called with null keys
123
123
* @return this builder
124
124
*/
125
- public EqualityTransformingBuilder <E > withHashHandlingNull (ToIntFunction <? super E > hash ) {
125
+ public EqualityTransformingCollectionBuilder <E > withHashHandlingNull (ToIntFunction <? super E > hash ) {
126
126
Objects .requireNonNull (hash , "The argument 'hash' must not be null." );
127
127
this .hash = hash ;
128
128
return this ;
@@ -133,7 +133,7 @@ public EqualityTransformingBuilder<E> withHashHandlingNull(ToIntFunction<? super
133
133
* a function computing the hash code of a key; will not be called with null keys
134
134
* @return this builder
135
135
*/
136
- public EqualityTransformingBuilder <E > withHash (ToIntFunction <? super E > hash ) {
136
+ public EqualityTransformingCollectionBuilder <E > withHash (ToIntFunction <? super E > hash ) {
137
137
Objects .requireNonNull (hash , "The argument 'hash' must not be null." );
138
138
return withHashHandlingNull (makeNullSafe (hash ));
139
139
}
0 commit comments