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

io.github.yangyouwang.core.ArrayWrapper Maven / Gradle / Ivy

There is a newer version: 1.8
Show newest version
package io.github.yangyouwang.core;

import io.github.yangyouwang.annotion.Wrapper;


/**
 * Array Wrap
 * @author yangyouwang
 */
public class ArrayWrapper extends BaseWorkerWrapper {

    @Override
    protected String wrapTheType(Wrapper annotation, String fieldName, String fieldValue) {
        String[] dictData = annotation.dictData();
        String separator = annotation.separator();
        String def = annotation.def();
        // 选择类型
        for (String dict : dictData) {
            String[] data = dict.split(separator);
            if (fieldValue.equals(data[0])) {
                return data[1];
            }
        }
        return def;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy