Java Stream Operation upcastStream(Stream stream)

Here you can find the source of upcastStream(Stream stream)

Description

upcast Stream

License

Open Source License

Declaration

@SuppressWarnings("unchecked")
    public static <T> Stream<T> upcastStream(Stream<? extends T> stream) 

Method Source Code

//package com.java2s;
/*/*from ww w  .j a  v a  2s  .  co m*/
 * Copyright (C) 2018 Scientific Analysis Instruments Limited <contact@saiman.co.uk>
 *          ______         ___      ___________
 *       ,'========\     ,'===\    /========== \
 *      /== \___/== \  ,'==.== \   \__/== \___\/
 *     /==_/____\__\/,'==__|== |     /==  /
 *     \========`. ,'========= |    /==  /
 *   ___`-___)== ,'== \____|== |   /==  /
 *  /== \__.-==,'==  ,'    |== '__/==  /_
 *  \======== /==  ,'      |== ========= \
 *   \_____\.-\__\/        \__\\________\/
 *
 * This file is part of uk.co.saiman.collections.
 *
 * uk.co.saiman.collections is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * uk.co.saiman.collections is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.util.stream.Stream;

public class Main {
    @SuppressWarnings("unchecked")
    public static <T> Stream<T> upcastStream(Stream<? extends T> stream) {
        return (Stream<T>) stream;
    }
}

Related

  1. stringPositions(StringBuilder toTest, Stream strings)
  2. toList(final Stream stream)
  3. toParameter(Stream input, Class exp)
  4. toString(IntStream s)
  5. toString(LongStream ls)
  6. zip(List> streams)
  7. zipWithIndex(Stream stream, int startIndex)