Class LeaderInformationRegister


  • public class LeaderInformationRegister
    extends Object
    A register containing the LeaderInformation for multiple contenders based on their componentId. No empty LeaderInformation is stored physically. No entry and an entry with an empty LeaderInformation are, therefore, semantically the same.
    • Constructor Detail

      • LeaderInformationRegister

        public LeaderInformationRegister​(Map<String,​LeaderInformation> leaderInformationPerComponentId)
        Creates a LeaderInformationRegister based on the passed leader information.
    • Method Detail

      • forComponentIdOrEmpty

        public LeaderInformation forComponentIdOrEmpty​(String componentId)
        Returns a LeaderInformation which is empty if no LeaderInformation is stored for the passed componentId.
      • getRegisteredComponentIds

        public Iterable<String> getRegisteredComponentIds()
        Returns the componentIds for which leader information is stored.
      • hasLeaderInformation

        public boolean hasLeaderInformation​(String componentId)
        Checks whether the register holds non-empty LeaderInformation for the passed componentId.
      • hasNoLeaderInformation

        public boolean hasNoLeaderInformation()
        Checks that no non-empty LeaderInformation is stored.
        Returns:
        true, if there is no entry that refers to a non-empty LeaderInformation; otherwise false (i.e. either no information is stored under any componentId or there are entries for certain componentIds that refer to an empty LeaderInformation record).