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

db.sql.api.impl.tookit.SqlUtil Maven / Gradle / Ivy

There is a newer version: 1.7.6-RC2
Show newest version
package db.sql.api.impl.tookit;

import db.sql.api.Getter;

import java.lang.reflect.Field;

public final class SqlUtil {

    private static final String AS_SPLIT = "$$";

    public static  String getAsName(Getter getter) {
        LambdaUtil.LambdaFieldInfo lambdaFieldInfo = LambdaUtil.getFieldInfo(getter);
        return lambdaFieldInfo.getType().getSimpleName() + AS_SPLIT + lambdaFieldInfo.getName();
    }

    public static String getAsName(Class clazz, Field field) {
        return clazz.getSimpleName() + AS_SPLIT + field.getName();
    }

    public static boolean isAsName(Class clazz, Field field, String name) {
        if (!name.contains(AS_SPLIT)) {
            return false;
        }
        return getAsName(clazz, field).equals(name);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy