-
Language:
English
-
Language:
English
11.12. Traits Example
declare GoldenCustomer @format(trait) // fields will map to getters/setters code : String balance : long discount : int maxExpense : long end
In order to apply a trait to an object, the new don keyword is added:
when $c : Customer() then GoldenCustomer gc = don( $c, Customer.class ); end