Skip to content

Instantly share code, notes, and snippets.

@salaboy
Created October 11, 2023 09:40
Show Gist options
  • Save salaboy/1c9dba30968164645088fd3fe230c979 to your computer and use it in GitHub Desktop.
Save salaboy/1c9dba30968164645088fd3fe230c979 to your computer and use it in GitHub Desktop.
Map.ofEntries(
Map.entry("apiVersion", "dapr.io/v1alpha1"),
Map.entry("kind", "Component"),
Map.entry(
"metadata", Map.ofEntries(
Map.entry("name", component.name)
)
),
Map.entry("spec", Map.ofEntries(
Map.entry("type", component.type),
Map.entry("version", "v1"),
Map.entry(
"metadata",
component.metadata.entrySet()
.stream()
.map(it -> Map.of("name", it.getKey(), "value", it.getValue()))
.toList()
)
))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment