Example usage for com.amazonaws.services.datapipeline.model Field Field

List of usage examples for com.amazonaws.services.datapipeline.model Field Field

Introduction

In this page you can find the example usage for com.amazonaws.services.datapipeline.model Field Field.

Prototype

Field

Source Link

Usage

From source file:com.shazam.dataengineering.pipelinebuilder.PipelineObject.java

License:Apache License

private HashSet<Field> parseFields(LinkedHashSet<Field> accumulator, Object json, String key) {
    if (json instanceof String) {
        accumulator.add(new Field().withKey(key).withStringValue((String) json));
    } else if (json instanceof JSONArray) {
        JSONArray fieldArray = (JSONArray) json;
        for (Object field : fieldArray) {
            parseFields(accumulator, field, key);
        }/*from w w w .  ja v  a2 s  . com*/
    } else if (json instanceof JSONObject) {
        String refValue = (String) ((JSONObject) json).get("ref");
        accumulator.add(new Field().withKey(key).withRefValue(refValue));
    }

    return accumulator;
}