All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.stream.impl.intops.object.DistinctOperation Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.infinispan.stream.impl.intops.object;

import org.infinispan.stream.impl.intops.IntermediateOperation;

import java.util.stream.Stream;

/**
 * Performs distinct operation on a regular {@link Stream}
 * @param  the type in the stream
 */
public class DistinctOperation implements IntermediateOperation, S, Stream> {
   private static final DistinctOperation OPERATION = new DistinctOperation<>();
   private DistinctOperation() { }

   public static  DistinctOperation getInstance() {
      return (DistinctOperation) OPERATION;
   }

   @Override
   public Stream perform(Stream stream) {
      return stream.distinct();
   }
}