tvaultapi/src/main/java/com/tmobile/cso/vault/api/controller/ControllerUtil.java
public static Response hideSelfSupportAdminAppRoleFromResponse(Response response, Integer limit, Integer offset) {
        ObjectMapper objMapper = new ObjectMapper();
        String jsonStr = response.getResponse();
        Map<String,String[]> requestMap = null;
        try {
            requestMap = objMapper.readValue(jsonStr, new TypeReference<Map<String,String[]>>() {});
        } catch (IOException e) {
            log.error(e);
        }
        if (null != requestMap.get("keys")) {
			List<String> policyList = new ArrayList<>(Arrays.asList((String[]) requestMap.get("keys")));
			policyList.removeAll(Arrays.asList(TVaultConstants.SELF_SUPPORT_ADMIN_APPROLES));

			limit = (limit == null)?policyList.size():limit;
			offset = (offset == null)?0:offset;
			Integer totalApproleCount = policyList.size();
			List<String> policyListResponse = new ArrayList<String>();
			int maxVal = policyList.size() > (limit+offset)?limit+offset : policyList.size();
			for (int i = offset; i < maxVal; i++) {
				policyListResponse.add(policyList.get(i));	
			}
			String nextVal = (totalApproleCount - (policyListResponse.size() + offset) > 0 ? String.valueOf((policyListResponse.size() + offset)) : "-1");
			String policies = policyListResponse.stream().collect(Collectors.joining("\", \""));

			if (StringUtils.isEmpty(policies)) {
				response.setResponse("{\"keys\": [],\"total\":0, \"next\":-1}");
			}
			else {
				response.setResponse("{\"keys\": [\"" + policies + "\"],\"total\":"+totalApproleCount+",\"next\":"+nextVal+"}");
			}	
		}
        return response;
    }
/**
     * To hide the selfsupport admin approle from responses to UI
     * @param response
     * @return
     */
To hide the selfsupport admin approle from responses to UI
@param response
@return
To hide the selfsupport admin approle from responses to UI @param response @return
public static Response hideSelfSupportAdminAppRoleFromResponse(Response response, Integer limit, Integer offset) {
        ObjectMapper objMapper = new ObjectMapper();
        String jsonStr = response.getResponse();
        Map<String,String[]> requestMap = null;
        try {
            requestMap = objMapper.readValue(jsonStr, new TypeReference<Map<String,String[]>>() {});
        } catch (IOException e) {
            log.error(e);
        }
        if (null != requestMap.get("keys")) {
			List<String> policyList = new ArrayList<>(Arrays.asList((String[]) requestMap.get("keys")));
			policyList.removeAll(Arrays.asList(TVaultConstants.SELF_SUPPORT_ADMIN_APPROLES));
			limit = (limit == null)?policyList.size():limit;
			offset = (offset == null)?0:offset;
			Integer totalApproleCount = policyList.size();
			List<String> policyListResponse = new ArrayList<String>();
			int maxVal = policyList.size() > (limit+offset)?limit+offset : policyList.size();
			for (int i = offset; i < maxVal; i++) {
				policyListResponse.add(policyList.get(i));	
			}
			String nextVal = (totalApproleCount - (policyListResponse.size() + offset) > 0 ? String.valueOf((policyListResponse.size() + offset)) : "-1");
			String policies = policyListResponse.stream().collect(Collectors.joining("\", \""));
			if (StringUtils.isEmpty(policies)) {
				response.setResponse("{\"keys\": [],\"total\":0, \"next\":-1}");
			}
			else {
				response.setResponse("{\"keys\": [\"" + policies + "\"],\"total\":"+totalApproleCount+",\"next\":"+nextVal+"}");
			}	
		}
        return response;
    }
public static Response hideSelfSupportAdminAppRoleFromResponse ( Response response , Integer limit , Integer offset ) { ObjectMapper objMapper = new ObjectMapper ( ) ; String jsonStr = response . getResponse ( ) ; Map < String , String [ ] > requestMap = null ; try { requestMap = objMapper . readValue ( jsonStr , new TypeReference < Map < String , String [ ] > > ( ) { } ) ; } catch ( IOException e ) { log . error ( e ) ; } if ( null != requestMap . get ( "keys" ) ) { List < String > policyList = new ArrayList < > ( Arrays . asList ( ( String [ ] ) requestMap . get ( "keys" ) ) ) ; policyList . removeAll ( Arrays . asList ( TVaultConstants . SELF_SUPPORT_ADMIN_APPROLES ) ) ; limit = ( limit == null ) ? policyList . size ( ) : limit ; offset = ( offset == null ) ? 0 : offset ; Integer totalApproleCount = policyList . size ( ) ; List < String > policyListResponse = new ArrayList < String > ( ) ; int maxVal = policyList . size ( ) > ( limit + offset ) ? limit + offset : policyList . size ( ) ; for ( int i = offset ; i < maxVal ; i ++ ) { policyListResponse . add ( policyList . get ( i ) ) ; } String nextVal = ( totalApproleCount - ( policyListResponse . size ( ) + offset ) > 0 ? String . valueOf ( ( policyListResponse . size ( ) + offset ) ) : "-1" ) ; String policies = policyListResponse . stream ( ) . collect ( Collectors . joining ( "\", \"" ) ) ; if ( StringUtils . isEmpty ( policies ) ) { response . setResponse ( "{\"keys\": [],\"total\":0, \"next\":-1}" ) ; } else { response . setResponse ( "{\"keys\": [\"" + policies + "\"],\"total\":" + totalApproleCount + ",\"next\":" + nextVal + "}" ) ; } } return response ; }
To hide the selfsupport admin approle from responses to UI
 @param response
 @return
To hide the selfsupport admin approle from responses to UI @param response @return