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

com.jwebmp.websockets.services.IWebSocketPreConfiguration Maven / Gradle / Ivy

Go to download

Provides Asynchronous and Dynamic Log Handler support for JDK1.8 logging API. Access via LogFactory.

The newest version!
package com.jwebmp.websockets.services;

import java.util.Comparator;

/**
 * A service for JWebMPWebSockets to configure app servers
 */
public interface IWebSocketPreConfiguration
		extends Comparable, Comparator
{
	void configure();

	default int compare(IWebSocketPreConfiguration o1, IWebSocketPreConfiguration o2)
	{
		return o1.getSortOrder()
		         .compareTo(o2.getSortOrder());
	}

	/**
	 * Returns any applicable sort order or 0 is assumed
	 *
	 * @return The sort order
	 */
	default Integer getSortOrder()
	{
		return 100;
	}

	default int compareTo(IWebSocketPreConfiguration o)
	{
		if (o == null)
		{
			return -1;
		}
		if (getClass().equals(o.getClass()))
		{
			return 0;
		}
		int result = getSortOrder().compareTo(o.getSortOrder());
		return result == 0 ? 1 : result;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy