public static BeanRule replicate(BeanRule beanRule) { BeanRule br = new BeanRule(); br.setId(beanRule.getId()); if (beanRule.getScanPattern() == null) { br.setBeanClass(beanRule.getBeanClass()); } br.setScopeType(beanRule.getScopeType()); br.setSingleton(beanRule.getSingleton()); br.setOfferBeanId(beanRule.getOfferBeanId()); br.setOfferMethodName(beanRule.getOfferMethodName()); br.setInitMethodName(beanRule.getInitMethodName()); br.setDestroyMethodName(beanRule.getDestroyMethodName()); br.setFactoryMethodName(beanRule.getFactoryMethodName()); br.setConstructorArgumentItemRuleMap(beanRule.getConstructorArgumentItemRuleMap()); br.setPropertyItemRuleMap(beanRule.getPropertyItemRuleMap()); br.setLazyInit(beanRule.getLazyInit()); br.setImportant(beanRule.getImportant()); br.setDescription(beanRule.getDescription()); br.setReplicated(true); return br; }