use of io.micronaut.core.annotation.Experimental in project micronaut-core by micronaut-projects.
the class ComputeInstanceMetadataResolverUtils method populateMetadata.
/**
* Populates the instance instance metadata's {@link AbstractComputeInstanceMetadata#setMetadata(Map)} property.
*
* @param instanceMetadata The instance metadata
* @param metadata A json object of metadata
*/
@Experimental
public static void populateMetadata(AbstractComputeInstanceMetadata instanceMetadata, JsonNode metadata) {
if (metadata != null) {
Map<String, String> finalMetadata = new HashMap<>(metadata.size());
for (Map.Entry<String, JsonNode> entry : metadata.entries()) {
JsonNode value = entry.getValue();
if (value.isString()) {
finalMetadata.put(entry.getKey(), value.getStringValue());
}
}
instanceMetadata.setMetadata(finalMetadata);
}
}
Aggregations