Here you can find the source of getClassNameFromConfig(Object config)
- class: Something param1: value1 OR - Something
Parameter | Description |
---|---|
config | the config |
public static String getClassNameFromConfig(Object config)
//package com.java2s; //License from project: Apache License import java.util.Map; public class Main { /**// ww w . j a v a 2 s .c o m * Given the standard configuration block in Yaml, extract the class name * * Block looks like: * * <pre> * - class: Something * param1: value1 * * OR * - Something * </pre> * * * @param config * the config * @return the class name from config */ public static String getClassNameFromConfig(Object config) { if (config instanceof String) { return (String) config; } else if (config instanceof Map) { Map<String, Object> consumer = (Map<String, Object>) config; return (String) consumer.get("class"); } else { return null; } } }