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

nl.vpro.domain.user.UserRepository Maven / Gradle / Ivy

Go to download

Domain classes and interfaces related to accountability, users and organizations.

There is a newer version: 8.3.1
Show newest version
/*
 * Copyright (C) 2010 Licensed under the Apache License, Version 2.0
 * VPRO The Netherlands
 */
package nl.vpro.domain.user;

import java.util.List;
import java.util.Optional;

public interface UserRepository {

    T attach(T user);

    Long count();

    /**
     * Gets user by id (so not the email)
     */
    Optional get(String id);

    T save(T user);

    T merge(T user);

    void delete(T user);

    void delete(OrganizationEditor join);

    default List findUsers(String name, int max) {
        return list().stream()
            .filter(u -> u.getDisplayName().toLowerCase().contains(name))
            .limit(max)
            .toList();
    }

    List list();

    void clear();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy