Skip to content

Commit 1548802

Browse files
joonhaengHeopull[bot]
authored andcommitted
Add java empty event struct (#31128)
1 parent e5fa766 commit 1548802

File tree

2 files changed

+929
-5
lines changed

2 files changed

+929
-5
lines changed

scripts/py_matter_idl/matter_idl/generators/java/ChipEventStructs_java.jinja

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ public class ChipEventStructs {
8080
{%- for cluster in clientClusters | sort(attribute='code') -%}
8181
{%- set typeLookup = idl | createLookupContext(cluster) %}
8282
{%- for event in cluster.events %}
83-
{%- if event.fields %}
8483
public static class {{cluster.name}}Cluster{{event.name}}Event {
8584
{%- for field in event.fields %}
8685
{%- set encodable = field | asEncodable(typeLookup) %}
@@ -133,6 +132,7 @@ public static class {{cluster.name}}Cluster{{event.name}}Event {
133132
{%- endif -%}
134133
;
135134
{%- endfor %}
135+
{%- if event.fields %}
136136
for (StructElement element: ((StructType)tlvValue).value()) {
137137
{%- for field in event.fields -%}
138138
{%- set encodable = field | asEncodable(typeLookup) %}
@@ -146,6 +146,7 @@ public static class {{cluster.name}}Cluster{{event.name}}Event {
146146
}
147147
{%- endraw %}
148148
}
149+
{%- endif %}
149150
return new {{cluster.name}}Cluster{{event.name}}Event(
150151
{%- for field in event.fields %}
151152
{{field.name}}{%- if loop.index0 < loop.length - 1 -%}{{","}}{%- endif %}
@@ -177,7 +178,6 @@ public static class {{cluster.name}}Cluster{{event.name}}Event {
177178
return output.toString();
178179
}
179180
}
180-
{%- endif %}
181181
{%- endfor %}
182182
{%- endfor %}
183183
}

0 commit comments

Comments
 (0)