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

com.vladsch.flexmark.util.collection.MaxAggregator Maven / Gradle / Ivy

The newest version!
package com.vladsch.flexmark.util.collection;

import java.util.function.BinaryOperator;
import org.jetbrains.annotations.Nullable;

public class MaxAggregator implements BinaryOperator {
  public static final MaxAggregator INSTANCE = new MaxAggregator();

  private MaxAggregator() {}

  @Override
  public @Nullable Integer apply(@Nullable Integer aggregate, @Nullable Integer next) {
    return next == null || aggregate != null && aggregate >= next ? aggregate : next;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy