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

com.fastchar.local.FastCharBaseLocal Maven / Gradle / Ivy

package com.fastchar.local;

import com.fastchar.interfaces.IFastLocalProvider;
import com.fastchar.utils.FastClassUtils;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.text.MessageFormat;

public class FastCharBaseLocal implements IFastLocalProvider {
    @Override
    public String getInfo(String key, Object... args) {
        try {
            Field declaredField = FastClassUtils.getDeclaredField(this.getClass(), key);
            if (declaredField != null) {
                declaredField.setAccessible(true);
                return MessageFormat.format(String.valueOf(declaredField.get(this)), args);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }



}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy