com.pulumi.serialization.internal.ValueVisitor Maven / Gradle / Ivy
package com.pulumi.serialization.internal;
import com.google.protobuf.Value;
import java.util.function.Consumer;
public final class ValueVisitor {
public static void visit(Value value, Consumer consumer) {
consumer.accept(value);
switch (value.getKindCase()) {
case KIND_NOT_SET:
throw new IllegalArgumentException("Unexpected value with KIND_NOT_SET");
case LIST_VALUE:
for (Value v : value.getListValue().getValuesList()) {
visit(v, consumer);
}
return;
case STRUCT_VALUE:
for (Value v : value.getStructValue().getFieldsMap().values()) {
visit(v, consumer);
}
return;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy