package net.pterodactylus.demoscenemusic.data;
import java.util.Collection;
+import java.util.Comparator;
/**
* Default implementation of a group data container.
*/
public class DefaultGroup extends DefaultBase implements Group {
+ /** Comparator that sorts groups by name. */
+ public static final Comparator<Group> NAME_COMPARATOR = new Comparator<Group>() {
+
+ @Override
+ public int compare(Group leftGroup, Group rightGroup) {
+ return leftGroup.getName().compareToIgnoreCase(rightGroup.getName());
+ }
+
+ };
+
/**
* Creates a new group data container.
*
* {@inheritDoc}
*/
@Override
- public String getUrl() {
- return getValue("url", String.class).get();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Group setUrl(String url) {
- getValue("url", String.class).set(url);
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
@SuppressWarnings("unchecked")
public Collection<Artist> getArtists() {
return getValue("artists", Collection.class).get();