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

com.descope.utils.MgmtUtils Maven / Gradle / Ivy

There is a newer version: 1.0.30
Show newest version
package com.descope.utils;

import static com.descope.utils.CollectionUtils.mapOf;

import com.descope.model.auth.AssociatedTenant;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import lombok.experimental.UtilityClass;

@UtilityClass
public class MgmtUtils {

  public static List> createAssociatedTenantList(
      List tenants) {
    if (tenants == null) {
      return null;
    }
    List> associatedTenantList = new ArrayList<>();
    for (AssociatedTenant tenant : tenants) {
      Map map = mapOf("tenantId", tenant.getTenantId(), "roleNames", tenant.getRoleNames());
      associatedTenantList.add(map);
    }
    return associatedTenantList;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy