code: private int rolesToMask(ArrayList<String> roles) {
          int mask = 0;
          if (roles != null) {
              for (String role: roles) {
                  switch (role) {
                      case "client":
                          mask |= 1;
                          break;       // Client mask
                      case "peer":
                          mask |= 2;
                          break;       // Peer mask
                      case "validator":
                          mask |= 4;
                          break;  // Validator mask
                      case "auditor":
                          mask |= 8;
                          break;    // Auditor mask
                  }
              }
          }
  
          if (mask == 0) mask = 1;  // Client
          return mask;
      }
docs: /*
  Convert a list of member type names to the role mask currently used by the peer