All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.serialization.internal.ValueVisitor Maven / Gradle / Ivy

There is a newer version: 0.17.0
Show newest version
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