Skip to content

Commit

Permalink
Clean codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
ashera96 committed Oct 18, 2023
1 parent a991ea0 commit da07b1e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,6 @@ void addSubscriptionPolicies(
void addApplicationKeyMappings(
List<org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping> applicationKeyMappingList);

/**
* Filter the API map according to the provided parameters
* @param name API Name
* @param context API Context
* @param version API Version
* @param uuid API UUID
* @return Matching list of apis.
*/
List<API> getMatchingAPIs(String name, String context, String version, String uuid);

/**
* Filter the API map according to the provided parameters
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,34 +293,6 @@ public void addApplicationMappings(
this.applicationMappingMap = newApplicationMappingMap;
}

@Override
public List<API> getMatchingAPIs(String name, String context, String version, String uuid) {

List<API> apiList = new ArrayList<>();
for (API api : apiMap.values()) {
boolean isNameMatching = true;
boolean isContextMatching = true;
boolean isVersionMatching = true;
boolean isUUIDMatching = true;
if (StringUtils.isNotEmpty(name)) {
isNameMatching = api.getApiName().contains(name);
}
if (StringUtils.isNotEmpty(context)) {
isContextMatching = api.getContext().equals(context);
}
if (StringUtils.isNotEmpty(version)) {
isVersionMatching = api.getApiVersion().equals(version);
}
if (StringUtils.isNotEmpty(uuid)) {
isUUIDMatching = api.getApiUUID().equals(uuid);
}
if (isNameMatching && isContextMatching && isVersionMatching && isUUIDMatching) {
apiList.add(api);
}
}
return apiList;
}

@Override
public API getMatchingAPI(String context, String version) {

Expand Down

0 comments on commit da07b1e

Please sign in to comment.