/** * A pair that does allows <code>null</code> values. * * @param first first value, may be <code>null</code> * @param second second value, may be <code>null</code> * @param <U> type of first value * @param <V> type of second value * @return new nice pair */ public static <U,V> Pair<U,V> nicePairOf(@Nullable U first, @Nullable V second) { return new Pair<U,V>(first, second); }
/** * A pair that doesn't allow <code>null</code> values. * * @param first first value, may not be <code>null</code> * @param second second value, may not be <code>null</code> * @param <U> type of first value * @param <V> type of second value * @return new strict pair */ public static <U,V> Pair<U,V> strictPairOf(@Nonnull U first, @Nonnull V second) { return new Pair<U,V>(notNull("first", first), notNull("second", second)); }