Skip to content

Commit

Permalink
add constants for key and value
Browse files Browse the repository at this point in the history
  • Loading branch information
asha15 committed Oct 18, 2023
1 parent c3b7ce9 commit 38858a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public class ExtensionMgtConstants {

public static final String EXTENSION_MANAGEMENT_PREFIX = "EXT-";

public static final String KEY = "key";

public static final String VALUE = "value";

/**
* Enum for error messages.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.identity.api.server.extension.management.common.utils.ExtensionMgtConstants;
import org.wso2.carbon.identity.api.server.extension.management.common.utils.ExtensionMgtUtils;
import org.wso2.carbon.identity.api.server.extension.management.v1.model.ExtensionListItem;
import org.wso2.carbon.identity.extension.mgt.model.ExtensionInfo;
Expand Down Expand Up @@ -52,8 +53,10 @@ public ExtensionListItem apply(ExtensionInfo extensionInfo) {
if (extensionInfo.getCustomAttributes() != null) {
for (Map<String, Object> customAttributeMap : extensionInfo.getCustomAttributes()) {
Map<String, Object> customAttribute = new HashMap<>();
customAttribute.put("key", customAttributeMap.get("key"));
customAttribute.put("value", customAttributeMap.get("value").toString());
customAttribute.put(ExtensionMgtConstants.KEY,
customAttributeMap.get(ExtensionMgtConstants.KEY));
customAttribute.put(ExtensionMgtConstants.VALUE,
customAttributeMap.get(ExtensionMgtConstants.VALUE).toString());
extensionListItem.addCustomAttributesItem(customAttribute);
}
}
Expand Down

0 comments on commit 38858a7

Please sign in to comment.