키와 값으로지도가 있으며 목표는 '키'목록을 얻는 것입니다. 배열 또는 목록으로 가져 오려고 생각 중입니다. SET에 키 값이있는 지점에 도달했지만 배열로 변환하는 방법을 파악하지 못했습니다.SET을 APEX의 배열로 변환하는 방법은 무엇입니까?
Map<String, String> mmm = new Map<String, String>();
mmm.put('one', 'oneee');
mmm.put('two', 'twooo');
mmm.put('three', 'threeee');
mmm.put('four', 'fourff');
//outputs values in the map
system.debug('=======values()==========>' + mmm.values());
//outputs key in the map
system.debug('=======keyset()===========>' + mmm.keyset());
//get keys in the type SET
SET<string> s = mmm.keyset();
//returns 4
system.debug('------------------------------------' + s.size());
s.arrayTo() //this method does not exist :(
여기에 'Set'에 대한 답변을 찾는 모든 이에 게; 이 질문은'Set'에 대해서 묻지 만 코드 예제는'Map'을 사용합니다. 이 솔루션에는'keyset()'에 대한 언급이 있지만 Set에 대해서는 존재하지 않습니다. 'Set'을'List'로 변환해야한다면, 대신에'Map'을 사용하고 그 값을 키로 추가하는 것입니다. 이것은'Set' 기능을 복제합니다. –