当前位置: 首页 > news >正文

800元做网站网站建设属什么费用

800元做网站,网站建设属什么费用,网络营销工作岗位有哪些,学做前端的网站前言: BeanUtils默认的populate方法不会忽略空值和null值,在特定场景,我们需要原始的值避免被覆盖,所以这里提供一种自定义实现方式。 package com.hmwl.service.program;import lombok.extern.slf4j.Slf4j; import org.apache.commons.beanu…

前言: BeanUtils默认的populate方法不会忽略空值和null值,在特定场景,我们需要原始的值避免被覆盖,所以这里提供一种自定义实现方式。

package com.hmwl.service.program;import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtilsBean;
import org.apache.commons.beanutils.ContextClassLoaderLocal;import java.lang.reflect.InvocationTargetException;
import java.util.Map;/*** @Author: martin* @Date: 2023/11/01 15:13 pm* @Description: apache common 原版populate不会过滤null值,不符合使用场景*/
@Slf4j
public class CustomBeanUtils extends BeanUtilsBean {private static final ContextClassLoaderLocal<CustomBeanUtils>BEANS_BY_CLASSLOADER = new ContextClassLoaderLocal<CustomBeanUtils>() {// Creates the default instance used when the context classloader is unavailable@Overrideprotected CustomBeanUtils initialValue() {return new CustomBeanUtils();}};public static CustomBeanUtils getInstance() {return BEANS_BY_CLASSLOADER.get();}public static void setInstance(final CustomBeanUtils newInstance) {BEANS_BY_CLASSLOADER.set(newInstance);}public static void populateIgnoreEmpty(final Object bean, final Map<String, ? extends Object> properties) {try {CustomBeanUtils.getInstance().populateIgnoreNull(bean, properties);} catch (IllegalAccessException e) {log.error(e.getMessage());} catch (InvocationTargetException e) {log.error(e.getMessage());}}private final void populateIgnoreNull(final Object bean, final Map<String, ? extends Object> properties)throws IllegalAccessException, InvocationTargetException {if ((bean == null) || (properties == null)) {return;}if (log.isDebugEnabled()) {log.debug("BeanUtils.populate(" + bean + ", " +properties + ")");}for (final Map.Entry<String, ? extends Object> entry : properties.entrySet()) {final String name = entry.getKey();// 增强下,因为可能多次调用,当value为null的时候不赋值if (name == null || entry.getValue() == null) {continue;}setProperty(bean, name, entry.getValue());}}
}

原版实现:

    public void populate(final Object bean, final Map<String, ? extends Object> properties)throws IllegalAccessException, InvocationTargetException {// Do nothing unless both arguments have been specifiedif ((bean == null) || (properties == null)) {return;}if (log.isDebugEnabled()) {log.debug("BeanUtils.populate(" + bean + ", " +properties + ")");}// Loop through the property name/value pairs to be setfor(final Map.Entry<String, ? extends Object> entry : properties.entrySet()) {// Identify the property name and value(s) to be assignedfinal String name = entry.getKey();if (name == null) {continue;}// Perform the assignment for this propertysetProperty(bean, name, entry.getValue());}}

http://www.yayakq.cn/news/662462/

相关文章:

  • 网站外接深圳电器公司招聘
  • 自己做的网站字体变成方框wordpress 目录
  • 源码网站代理图片做网站连接
  • 应聘网站建设工程师芜湖商城网站建设
  • 做公众号可以看的网站电子政务 和网站建设总结
  • 装修公司资质查询官方网站唐山专业网站建设
  • 做赚钱问卷调查的网站好现在的网站开发方式
  • 有空间站的国家九江专业网站建设
  • 三墩网站建设确定网站建设目标
  • 武清做网站企业网站模板源码有哪些
  • 网站建设服务商城美食网页设计素材
  • 可以做很多个网站然后哭推广wordpress主题无法显示
  • 有什么网站招聘做危险高薪工作的百度上做网站模板
  • 苏州地产网站建设toom舆情监测软件
  • 做网站全国最大wordpress基本
  • 做医疗的网站建设国外做建材的网站有哪些
  • 好一点网站建设公司上海大型网站
  • 铁岭市做网站wordpress创意主题店铺
  • 于飞网站开发wordpress设置文章登录可见
  • 快速建站属于saas吗洛南网站建设
  • 大型门户网站设计搜索引擎优化面对哪些困境
  • 大连旅顺网站制作厦门网站建设招标
  • 网页设计专业培训企业网站建设有名 乐云seo
  • 做一个中型网站需要多少钱做分类信息网站代码
  • 延吉网站建设零库存品牌童装杭州网站建设
  • 做解析会员电影的网站百度免费网站制作
  • 如何注册公司需要多少钱成都网站优化服务
  • 荥阳网站建设价格成都市建设厅网站
  • 建设网站套餐广东省城乡与住房建设厅网站
  • 下载建网站宁晋seo网站优化排名