We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/**
*/ public class ValueUtils{
/** * 如果judgeValue的值为null且value不为null则调用set.accept方法 * * @param judgeValue * 待判断的值 * @param set * 设置器 * @param value * 给与设置器的值 */ public static <T> void setValueIfNull(Supplier<T> judgeValue,Consumer<T> set,T value){ if (judgeValue.get() == null && value != null){ set.accept(value); } } public static <T> void setValueIfNotNull(Supplier<T> newValue,Consumer<T> consumer){ if (newValue.get() != null){ consumer.accept(newValue.get()); } }
}
// 默认主站专辑 ValueUtils.setValueIfNull(albumQueryDTO::getAlbumScope, albumQueryDTO::setAlbumScope, "111111");
The text was updated successfully, but these errors were encountered:
No branches or pull requests
/**
*/
public class ValueUtils{
}
// 默认主站专辑
ValueUtils.setValueIfNull(albumQueryDTO::getAlbumScope, albumQueryDTO::setAlbumScope, "111111");
The text was updated successfully, but these errors were encountered: