package com.github.mybatisplus.toolkit; import com.baomidou.mybatisplus.core.toolkit.LambdaUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.support.SFunction; import org.apache.ibatis.reflection.property.PropertyNamer; /** * @author yulichang * @see LambdaUtils * @see PropertyNamer */ @SuppressWarnings("all") public final class MyLambdaUtils { public static String getName(SFunction fn) { return PropertyNamer.methodToProperty(LambdaUtils.resolve(fn).getImplMethodName()); } public static String getColumn(SFunction fn) { return StringUtils.camelToUnderline(getName(fn)); } public static Class getEntityClass(SFunction fn) { return (Class) LambdaUtils.resolve(fn).getInstantiatedType(); } }