DateUtils
1
import org.apache.commons.lang3.time.DateUtils;
https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/time/DateUtils.html
truncate
- addMilliseconds
1 2
Date now = new Date(); Date new = DateUtils.addMilliseconds(now, -1);
- addDays
1 2
Date now = new Date(); DateUtils.addDays(now, 1);
ceiling
- parseDate
1
2
Date now = new Date();
Date parse = DateUtils.parseDate(now, "yyyyMMdd", "yyyy-MM-dd");
StringUtils
1
2
3
import org.springframework.util.StringUtils;
import org.apache.commons.lang3.StringUtils;
- spring
- apache
https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html
CollectionUtils
1
2
3
import org.springframework.util.CollectionUtils;
import org.apache.commons.collections4.CollectionUtils;
- spring
- apache
ObjectUtils
1
2
3
import org.springframework.util.ObjectUtils;
import org.apache.commons.lang3.ObjectUtils;
- spring
- apache
https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/ObjectUtils.html
NumberUtils
1
import org.apache.commons.lang3.math.NumberUtils;
Comments powered by Disqus.