Commit 55e95336 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Update UserRepository class.

From Java to Kotlin. Also delete the SortDirection attribute (avoid conditionals checks).
parent 80ee4fde
package chat.rocket.core.repositories;
import com.hadisatrio.optional.Optional;
import io.reactivex.Flowable;
import java.util.List;
import chat.rocket.core.SortDirection;
import chat.rocket.core.models.User;
public interface UserRepository {
Flowable<Optional<User>> getCurrent();
Flowable<List<User>> getSortedLikeName(String name, SortDirection direction, int limit);
}
package chat.rocket.core.repositories
import com.hadisatrio.optional.Optional
import io.reactivex.Flowable
import chat.rocket.core.models.User
interface UserRepository {
fun getCurrent(): Flowable<Optional<User>>
fun getByUsername(username: String): Flowable<Optional<User>>
fun getSortedLikeName(name: String, limit: Int): Flowable<List<User>>
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment