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

com.jwebmp.guicedinjection.interfaces.IGuiceModule Maven / Gradle / Ivy

Go to download

Guice Injection allows you to access multiple Guice Binders and Modules across separate archives. Allowing you to configure your applications with injection from multiple dependancies. Servlets, EJB's, and Stand-Alone is supported. Requires JDK 8 or 10.

There is a newer version: 0.66.0.1
Show newest version
package com.jwebmp.guicedinjection.interfaces;

import javax.validation.constraints.NotNull;
import java.util.Comparator;

/**
 * Service Locator for configuring the module
 */
public interface IGuiceModule extends Comparable, Comparator
{
	default int compare(IGuiceModule o1, IGuiceModule o2)
	{
		if (o1 == null || o2 == null)
		{
			return -1;
		}
		return o1.sortOrder()
		         .compareTo(o2.sortOrder());
	}

	default Integer sortOrder()
	{
		return 100;
	}

	default int compareTo(@NotNull IGuiceModule o)
	{
		int sort = sortOrder().compareTo(o.sortOrder());
		if (sort == 0)
		{
			return -1;
		}
		return sort;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy