// Path: src/main/java/net/pterodactylus/wotns/freenet/wot/Identity.java
// public interface Identity {
// 
// 	/**
// 	 * Returns the ID of the identity.
// 	 *
// 	 * @return The ID of the identity
// 	 */
// 	public String getId();
// 
// 	/**
// 	 * Returns the nickname of the identity.
// 	 *
// 	 * @return The nickname of the identity
// 	 */
// 	public String getNickname();
// 
// 	/**
// 	 * Returns the request URI of the identity.
// 	 *
// 	 * @return The request URI of the identity
// 	 */
// 	public String getRequestUri();
// 
// 	/**
// 	 * Returns all contexts of this identity.
// 	 *
// 	 * @return All contexts of this identity
// 	 */
// 	public Set<String> getContexts();
// 
// 	/**
// 	 * Returns whether this identity has the given context.
// 	 *
// 	 * @param context
// 	 *            The context to check for
// 	 * @return {@code true} if this identity has the given context,
// 	 *         {@code false} otherwise
// 	 */
// 	public boolean hasContext(String context);
// 
// 	/**
// 	 * Returns all properties of this identity.
// 	 *
// 	 * @return All properties of this identity
// 	 */
// 	public Map<String, String> getProperties();
// 
// 	/**
// 	 * Returns the value of the property with the given name.
// 	 *
// 	 * @param name
// 	 *            The name of the property
// 	 * @return The value of the property
// 	 */
// 	public String getProperty(String name);
// 
// 	/**
// 	 * Retrieves the trust that this identity receives from the given own
// 	 * identity. If this identity is not in the own identity’s trust tree, a
// 	 * {@link Trust} is returned that has all its elements set to {@code null}.
// 	 * If the trust can not be retrieved, {@code null} is returned.
// 	 *
// 	 * @param ownIdentity
// 	 *            The own identity to get the trust for
// 	 * @return The trust assigned to this identity, or {@code null} if the trust
// 	 *         could not be retrieved
// 	 */
// 	public Trust getTrust(OwnIdentity ownIdentity);
// 
// }


import java.util.Comparator;
import net.pterodactylus.wotns.freenet.wot.Identity;
/*
 * WoTNS - IdentityComparator.java - Copyright © 2011 David Roden
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package net.pterodactylus.wotns.main;



/**
 * Contains several comparators that can be used with {@link Identity}s. At the
 * moment only a single {@link Comparator} is defined; it sorts identities
 * case-insensitively by name.
 *
 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
 */
public class IdentityComparator {

	/** Comparator for sorting by name. */
	@SuppressWarnings("synthetic-access")
	public static final Comparator<Identity> NAME = new IdentityNameComparator();

	/**
	 * {@link Comparator} for {@link Identity}s that sorts case-insensitively by
	 * name.
	 *
	 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
	 */
	private static class IdentityNameComparator implements Comparator<Identity> {

		/**
		 * {@inheritDoc}
		 */
		@Override
// Path: src/main/java/net/pterodactylus/wotns/freenet/wot/Identity.java
// public interface Identity {
// 
// 	/**
// 	 * Returns the ID of the identity.
// 	 *
// 	 * @return The ID of the identity
// 	 */
// 	public String getId();
// 
// 	/**
// 	 * Returns the nickname of the identity.
// 	 *
// 	 * @return The nickname of the identity
// 	 */
// 	public String getNickname();
// 
// 	/**
// 	 * Returns the request URI of the identity.
// 	 *
// 	 * @return The request URI of the identity
// 	 */
// 	public String getRequestUri();
// 
// 	/**
// 	 * Returns all contexts of this identity.
// 	 *
// 	 * @return All contexts of this identity
// 	 */
// 	public Set<String> getContexts();
// 
// 	/**
// 	 * Returns whether this identity has the given context.
// 	 *
// 	 * @param context
// 	 *            The context to check for
// 	 * @return {@code true} if this identity has the given context,
// 	 *         {@code false} otherwise
// 	 */
// 	public boolean hasContext(String context);
// 
// 	/**
// 	 * Returns all properties of this identity.
// 	 *
// 	 * @return All properties of this identity
// 	 */
// 	public Map<String, String> getProperties();
// 
// 	/**
// 	 * Returns the value of the property with the given name.
// 	 *
// 	 * @param name
// 	 *            The name of the property
// 	 * @return The value of the property
// 	 */
// 	public String getProperty(String name);
// 
// 	/**
// 	 * Retrieves the trust that this identity receives from the given own
// 	 * identity. If this identity is not in the own identity’s trust tree, a
// 	 * {@link Trust} is returned that has all its elements set to {@code null}.
// 	 * If the trust can not be retrieved, {@code null} is returned.
// 	 *
// 	 * @param ownIdentity
// 	 *            The own identity to get the trust for
// 	 * @return The trust assigned to this identity, or {@code null} if the trust
// 	 *         could not be retrieved
// 	 */
// 	public Trust getTrust(OwnIdentity ownIdentity);
// 
// }


// Path: src/main/java/net/pterodactylus/wotns/main/IdentityComparator.java
import java.util.Comparator;
import net.pterodactylus.wotns.freenet.wot.Identity;

/*
 * WoTNS - IdentityComparator.java - Copyright © 2011 David Roden
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package net.pterodactylus.wotns.main;



/**
 * Contains several comparators that can be used with {@link Identity}s. At the
 * moment only a single {@link Comparator} is defined; it sorts identities
 * case-insensitively by name.
 *
 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
 */
public class IdentityComparator {

	/** Comparator for sorting by name. */
	@SuppressWarnings("synthetic-access")
	public static final Comparator<Identity> NAME = new IdentityNameComparator();

	/**
	 * {@link Comparator} for {@link Identity}s that sorts case-insensitively by
	 * name.
	 *
	 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
	 */
	private static class IdentityNameComparator implements Comparator<Identity> {

		/**
		 * {@inheritDoc}
		 */
		@Override
		public int compare(Identity leftIdentity, Identity rightIdentity) {