https://github.com/lonecloud/objectutils
https://github.com/lonecloud/objectutils
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/lonecloud/objectutils
- Owner: lonecloud
- Created: 2017-03-12T01:38:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-05-29T01:40:58.000Z (about 8 years ago)
- Last Synced: 2025-04-12T15:03:52.176Z (about 1 year ago)
- Language: Java
- Size: 6.84 KB
- Stars: 2
- Watchers: 1
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Object转Map工具类
1. objectToMap(Object obj)
- 参数:
- object 传入的对象
- 返回:
- Map
- 返回值的构造
- key: 参数名
- value: 值String
2. Map objectToMapString(String timeFormatStr, Object obj, String... excludeFields)
参数:
- timeFormatStr **非必须** 对时间格式化字符默认格式化:2017-03-10 10:21
- object 传入的对象
- excludeFields 需要排除的对象
- 传入格式:
- User 对象中有三个属性id,name,year
- 排除name 则输入User.name
- 返回:
- Map
- 返回值的构造
- key: 简单类名.参数名
- value: 值为String