com.societegenerale.githubcrawler.model.team.Membership.kt Maven / Gradle / Ivy
package com.societegenerale.githubcrawler.model.team
import java.util.function.Consumer
class Membership {
private val membersToTeam = HashMap>()
fun add(team: Team, members: Set) {
members.forEach(Consumer {
membersToTeam[it.login]
?.add(team.name)
?: membersToTeam.put(it.login, mutableSetOf(team.name))
})
}
fun getTeams(memberLogin : String) : MutableSet {
return membersToTeam[memberLogin] ?: mutableSetOf(memberLogin)
}
fun isEmpty() : Boolean {
return membersToTeam.isEmpty()
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy