commons.apache
1、ToStringBuilder
- //对象及其属性一行显示
- System.out.println(ToStringBuilder.reflectionToString(u));
- System.out.println(ToStringBuilder.reflectionToString(u, ToStringStyle.DEFAULT_STYLE));
- //属性换行显示
- System.out.println(ToStringBuilder.reflectionToString(u, ToStringStyle.MULTI_LINE_STYLE));
- //不显示属性名,只显示属性值,在同一行显示
- System.out.println(ToStringBuilder.reflectionToString(u, ToStringStyle.NO_FIELD_NAMES_STYLE));
- //对象名称简写
- System.out.println(ToStringBuilder.reflectionToString(u, ToStringStyle.SHORT_PREFIX_STYLE));
- //只显示属性
- System.out.println(ToStringBuilder.reflectionToString(u, ToStringStyle.SIMPLE_STYLE));
结果显示:
test.User@141d683[name=zhengtian,age=25]
test.User@141d683[name=zhengtian,age=25]
test.User@141d683[
name=zhengtian
age=25
]
test.User@141d683[zhengtian,25]
User[name=zhengtian,age=25]
zhengtian,25
commons.apache的更多相关文章
- Apache commons——Apache旗下的通用工具包项目
Apache Commons是Apache旗下的一个开源项目,包含了很多开源的工具,用于解决平时编程经常会遇到的问题,减少重复劳动 这里是Apache commons的官方网站 下面是工具的简单介绍: ...
- Apache Commons Chain
http://commons.apache.org/proper/commons-chain/ http://commons.apache.org/proper/commons-chain/cookb ...
- Apache Commons Collections
http://commons.apache.org/proper/commons-collections/userguide.html 1. Utilities SetUtils Collection ...
- Apache Commons Lang
http://commons.apache.org/proper/commons-lang/javadocs/api-release/org/apache/commons/lang3/package- ...
- Apache Commons BeanUtils
http://commons.apache.org/proper/commons-beanutils/javadocs/v1.9.2/apidocs/org/apache/commons/beanut ...
- Apache Commons 系列简介 之 Pool
一.概述 Apache Commons Pool库提供了一整套用于实现对象池化的API,以及若干种各具特色的对象池实现.2.0版本,并非是对1.x的简单升级,而是一个完全重写的对象池的实现,显著的提升 ...
- 【java】org.apache.commons.lang3功能示例
org.apache.commons.lang3功能示例 package com.simple.test; import java.util.Date; import java.util.Iterat ...
- 编写更少量的代码:使用apache commons工具类库
Commons-configuration Commons-FileUpload Commons DbUtils Commons BeanUtils Commons CLI Commo ...
- apache commons Java包简介
更多信息,请参考:http://commons.apache.org/ 一.Commons BeanUtils说明:针对Bean的一个工具集.由于Bean往往是有一堆get和set组成,所以BeanU ...
随机推荐
- How to debug add-ins for arcgis
Debugging add-ins To debug an add-in, follow these steps: Confirm that the add-in is deployed to the ...
- SpringBoot入门,新建SpringBoot项目
一.在Spring Initializr中创建初始化项目 https://start.spring.io/ 二.通过maven导入Idea中(解压后的项目) 解压文件 黄色的为项目需要的真正的代码 , ...
- JAVA web项目转客户端(nativefier)
1.环境:windows 2.下载node.js 3.安装mode.js;记住安装目录 4.命令行进入安装目录 5.执行语句: npm install nativefier –g 进行安装 6.新建空 ...
- 同时使用多个UITableView
1.xib\storyboard中给2个tableView设置constraints(等宽) 方法 : ①设置mainTableView的上\下\左\三部分的约束为0:subTableView上\下\ ...
- 初涉倍增&&LCA【在更】
一种特殊的枚举算法 什么是倍增 顾名思义,即每一次翻倍增加.那么,这样我们就有了一种$O(logn)$阶的方法处理枚举方面的问题了. 参考:[白话系列]倍增算法 一些题目 [倍增]luoguP1613 ...
- biological clock
'''this application aimed to cauculate people's biological block about emotional(28), energy(23),int ...
- (转) 苹果所有常用证书,appID,Provisioning Profiles配置说明及制作图文教程(精)
原文地址:http://blog.csdn.net/holydancer/article/details/9219333 概述: 苹果的证书繁锁复杂,制作管理相当麻烦,今天决定重置一个游戏项目中的所有 ...
- HDU 2476 区间DP String painter
题解 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm ...
- 00030_ArrayList集合
1.数组可以保存多个元素,但在某些情况下无法确定到底要保存多少个元素,此时数组将不再适用,因为数组的长度不可变 2.JDK中提供了一系列特殊的类,这些类可以存储任意类型的元素,并且长度可变,统称为集合 ...
- bootshiro---开源的后台管理框架--基于springboot2+ shiro+jwt的真正rest api资源无状态认证权限管理框架,开发人员无需关注权限问题,后端开发完api,前端页面配置即可
https://gitee.com/tomsun28/bootshiro