org.minijax.db.NamedEntity Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of minijax-db Show documentation
Show all versions of minijax-db Show documentation
Minijax database and entity model
package org.minijax.db;
import java.net.URI;
import java.security.Principal;
import java.util.Collections;
import java.util.List;
/**
* The NamedEntity class is a base class for web entities with names.
*/
public interface NamedEntity extends BaseEntity, Principal {
String getHandle();
@Override
String getName();
void setName(String name);
Avatar getAvatar();
void setAvatar(Avatar avatar);
default URI getUri() {
return null;
}
/**
* Sorts a list of ID objects by name (ascending).
*
* @param list The list of named entities (modified in place).
*/
static void sortByName(final List list) {
Collections.sort(list, (o1, o2) -> o1.getName().compareTo(o2.getName()));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy