Class RoleMap


public class RoleMap extends Object
Add custom roles to the rolemap, must be done before initializing protocols. By mapping the name of the role to an instance annotations are no longer limited to the default roles in #Role.
  • Field Details

  • Constructor Details

    • RoleMap

      public RoleMap()
  • Method Details

    • put

      public static void put(String name, RoleType role)
      Adds a role mapping.
      name - the name of the role.
      role - the role implementation.
    • get

      public static RoleType get(String name)
      retrieves a role by its name.
      name - the name of the role to retrieve.
      a registered role that matches the given name, throws an exception if the role is not registered.
    • get

      public static RoleType[] get(String... names)
      names - multiple names to retrieve the roles for.
      a list of roles that matches the given list. Throws an exception if any of the roles in the given names is not registered.