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

org.minijax.db.NamedEntity Maven / Gradle / Ivy

There is a newer version: 0.4.14
Show newest version
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