Untitled
Use below approach(Not tested) 1. create a class like below Features{ int id; String feature; boolean enabled; } 2. declare a map like Map <String, List<Feature>> featuresMap = new HashMap...; 3. instantiate Features class (use setter/constructor/builder) Features feature1 = Features.builder() .id(1) .feature("BLOCK_SIGN_IN") .enabled(true).build(); Features feature2 = Features.builder() .id(2) .feature("BLOCK_AUTO_PAYMENT") .enabled(true).build(); 4. add the classes to map featuresMap = Map.of("features", List.of(feature1, feature2)); 5. return the map put featuresMap inside response body
Leave a Comment