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

com.societegenerale.githubcrawler.model.team.Membership.kt Maven / Gradle / Ivy

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