Example usage for java.util.function UnaryOperator identity

List of usage examples for java.util.function UnaryOperator identity

Introduction

In this page you can find the example usage for java.util.function UnaryOperator identity.

Prototype

static <T> UnaryOperator<T> identity() 

Source Link

Document

Returns a unary operator that always returns its input argument.

Usage

From source file:com.github.horrorho.inflatabledonkey.args.Arg.java

public Arg(Property property, Option option) {
    this(property, option, UnaryOperator.identity());
}

From source file:com.asakusafw.runtime.io.text.csv.CsvFieldReader.java

/**
 * Creates a new instance./*from  w ww  .ja  v  a  2 s. c  o  m*/
 * @param reader the source text reader
 * @param fieldSeparator the field separator character
 * @param quoteCharacter the quote character
 * @param allowLineFeed {@code true} to allow LF in field, otherwise {@code false}
 * @param transformer the line content transformer (nullable)
 */
public CsvFieldReader(Reader reader, char fieldSeparator, char quoteCharacter, boolean allowLineFeed,
        UnaryOperator<CharSequence> transformer) {
    this.lineCursor = new LineCursor(reader, quoteCharacter, fieldSeparator, allowLineFeed);
    this.fieldSeparator = fieldSeparator;
    this.quoteCharacter = quoteCharacter;
    this.transformer = transformer == null ? UnaryOperator.identity() : transformer;
}

From source file:org.briljantframework.array.AbstractComplexArray.java

@Override
public Complex reduce(Complex identity, BinaryOperator<Complex> reduce) {
    return reduce(identity, reduce, UnaryOperator.identity());
}

From source file:org.apache.accumulo.core.client.summary.CountingSummarizer.java

/**
 * Override this if your key type is mutable and subject to change.
 *
 * @return a function that used to copy the counter object. This function is only used when the
 *         collector has never seen the counter object before. In this case the collector needs to
 *         possibly copy the counter object before using as map key. The default implementation is
 *         the {@link UnaryOperator#identity()} function.
 *//*w ww.  j  a v a2 s  .  c  om*/
protected UnaryOperator<K> copier() {
    return UnaryOperator.identity();
}

From source file:com.asakusafw.runtime.io.text.directio.AbstractTextStreamFormatTest.java

private MockFormat format(HeaderType headerType, String... header) {
    RecordDefinition.Builder<String[]> builder = RecordDefinition.builder(String[].class);
    if (headerType != null) {
        builder.withHeaderType(headerType);
    }//w w w .  ja v a 2  s .c  o  m
    for (int i = 0; i < header.length; i++) {
        FieldDefinition<String[]> field = FieldDefinition.builder(header[i], MockFieldAdapter.supplier(i))
                .build();
        builder.withField(UnaryOperator.identity(), field);
    }
    MockFormat format = new MockFormat(builder.build());
    format.setConf(new Configuration());
    return format;
}

From source file:org.apache.hyracks.maven.license.GenerateFileMojo.java

private void resolveLicenseFiles() throws MojoExecutionException, IOException {
    resolveArtifactFiles("LICENSE", entry -> entry.getName().matches("(.*/|^)" + "LICENSE" + "(.txt)?"),
            Project::setLicenseText, UnaryOperator.identity());
}

From source file:org.apache.jena.query.text.TextIndexLucene.java

@Override
public List<TextHit> query(Node property, String qs, String graphURI, String lang, int limit,
        String highlight) {/*ww  w. j  a v a2 s.  c  om*/
    try (IndexReader indexReader = DirectoryReader.open(directory)) {
        return query$(indexReader, property, qs, UnaryOperator.identity(), graphURI, lang, limit, highlight);
    } catch (ParseException ex) {
        throw new TextIndexParseException(qs, ex.getMessage());
    } catch (Exception ex) {
        throw new TextIndexException("query", ex);
    }
}

From source file:org.geowebcache.config.wms.GetCapabilitiesConfiguration.java

public void afterPropertiesSet() throws GeoWebCacheException {
    List<TileLayer> tileLayers = getTileLayers(true);
    Set<String> brokerNames = gridSetBroker.getGridSetNames();
    for (TileLayer layer : tileLayers) {
        layer.initialize(gridSetBroker);
        if (primaryConfig != null) {
            primaryConfig.setDefaultValues(layer);
        } else if (log.isErrorEnabled()) {
            log.error("GetCapabilitiesConfiguration could not initialize a layer with default "
                    + "values as it does not have a global configuration to delegate to.");
        }//from   ww  w .ja  va 2s. c  o m
        layers.put(layer.getName(), layer);

        Map<String, GridSet> generatedForLayer = Sets.difference(layer.getGridSubsets(), brokerNames).stream()
                .map(layer::getGridSubset).map(GridSubset::getGridSet)
                .collect(Collectors.toMap(GridSet::getName, UnaryOperator.identity()));
        generatedGridSets.putAll(generatedForLayer);
    }
}

From source file:net.dv8tion.jda.core.entities.EntityBuilder.java

private Map<String, AuditLogChange> changeToMap(Set<AuditLogChange> changesList) {
    return changesList.stream().collect(Collectors.toMap(AuditLogChange::getKey, UnaryOperator.identity()));
}