11package org .whaka .data ;
22
3- import static org .whaka .util .UberStreams .*;
43import static java .util .Arrays .*;
4+ import static org .whaka .util .UberStreams .stream ;
55
66import java .util .ArrayList ;
77import java .util .Collection ;
2727 * <li>{@link #nullableEnd(Collection)}
2828 * </ul>
2929 */
30+ @ SuppressWarnings ({"unchecked" , "rawtypes" })
3031public class NullStrategy {
3132
3233 /**
@@ -37,7 +38,6 @@ public class NullStrategy {
3738 * <li>{@link #apply(Collection)} specified collection will be transformed into a list without any other changes.
3839 * </ul>
3940 */
40- @ SuppressWarnings ("unchecked" )
4141 public static NullStrategy NO_STRATEGY = new NullStrategy (ArrayList ::new );
4242
4343 /**
@@ -58,10 +58,8 @@ public class NullStrategy {
5858 */
5959 public static NullStrategy NULLABLE_END = new NullStrategy (NullStrategy ::nullableEnd );
6060
61- @ SuppressWarnings ("rawtypes" )
6261 private final Function <Collection , List > function ;
6362
64- @ SuppressWarnings ("rawtypes" )
6563 private NullStrategy (Function <Collection , List > function ) {
6664 this .function = function ;
6765 }
@@ -70,7 +68,6 @@ private NullStrategy(Function<Collection, List> function) {
7068 * Specified array is cloned <b>in any case</b>.
7169 * Any other behavior is specific to a strategy.
7270 */
73- @ SuppressWarnings ("unchecked" )
7471 public <T > T [] apply (T [] arr ) {
7572 return (T []) stream (apply (asList (arr ))).toArray (arr .getClass ().getComponentType ());
7673 }
@@ -79,7 +76,6 @@ public <T> T[] apply(T[] arr) {
7976 * Specified collection is copied into a list <b>in any case</b>.
8077 * Any other behavior is specific to a strategy.
8178 */
82- @ SuppressWarnings ("unchecked" )
8379 public <T > List <T > apply (Collection <T > col ) {
8480 return function .apply (col );
8581 }
0 commit comments