Zhi Dou | 4655c96 | 2023-06-12 15:56:03 +0000 | [diff] [blame] | 1 | package {package_name}; |
| 2 | |
| 3 | public final class Flags \{ |
MÃ¥rten Kongstad | a2e152a | 2023-06-19 16:11:33 +0200 | [diff] [blame] | 4 | {{- for item in class_elements}} |
| 5 | public static final String FLAG_{item.flag_name_constant_suffix} = "{item.device_config_flag}"; |
| 6 | {{- endfor }} |
Zhi Dou | 4655c96 | 2023-06-12 15:56:03 +0000 | [diff] [blame] | 7 | {{ for item in class_elements}} |
| 8 | public static boolean {item.method_name}() \{ |
| 9 | return FEATURE_FLAGS.{item.method_name}(); |
| 10 | } |
| 11 | {{ endfor }} |
Zhi Dou | 8ba6aa7 | 2023-06-26 21:03:40 +0000 | [diff] [blame] | 12 | {{ if is_test_mode }} |
| 13 | public static void setFeatureFlagsImpl(FeatureFlags featureFlags) \{ |
| 14 | Flags.FEATURE_FLAGS = featureFlags; |
| 15 | } |
| 16 | |
| 17 | public static void unsetFeatureFlagsImpl() \{ |
| 18 | Flags.FEATURE_FLAGS = null; |
| 19 | } |
| 20 | {{ -endif}} |
| 21 | |
| 22 | private static FeatureFlags FEATURE_FLAGS{{ -if not is_test_mode }} = new FeatureFlagsImpl(){{ -endif- }}; |
Zhi Dou | 4655c96 | 2023-06-12 15:56:03 +0000 | [diff] [blame] | 23 | |
| 24 | } |