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

io.vertx.core.spi.Utils Maven / Gradle / Ivy

There is a newer version: 5.0.0.CR1
Show newest version
package io.vertx.core.spi;

import io.vertx.core.ServiceHelper;
import io.vertx.core.json.jackson.JacksonFactory;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

class Utils {

  static io.vertx.core.spi.JsonFactory load() {
    List factories = new ArrayList<>(ServiceHelper.loadFactories(io.vertx.core.spi.JsonFactory.class));
    factories.sort(Comparator.comparingInt(JsonFactory::order));
    if (factories.size() > 0) {
      return factories.iterator().next();
    } else {
      return JacksonFactory.INSTANCE;
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy