com.jwebmp.guicedinjection.interfaces.IGuiceModule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of guiced-injection Show documentation
Show all versions of guiced-injection Show documentation
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.
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;
}
}