Feature Overview
This feature enables destructuring from list/map/sobject.
This feature enables destructuring from list/map/sobject.
None
public class DestructureDemo {
public static void main() {
List names = new List{ 'Wilson', 'Adam' };
String { p1, p2 } = names;
Map infos = new Map{ 'a' => 1, 'b' => '2' };
{ a: Integer count, b: String id } = infos;
Account ac = new Account(Name='test acc');
{ Name: String name } = ac;
List numbers = new List{ 1, 2, 3, 4, 5 };
Integer { first, _ } = numbers;
Integer { _, last } = numbers;
List signs = new List{};
String { sign : String = 'stop' } = signs;
}
}
public class DestructureDemo {
public static void main() {
List names = new List{ 'Wilson', 'Adam' };
List