mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix comment
This commit is contained in:
parent
fb2596b6c7
commit
ea3e59a331
@ -193,16 +193,16 @@ public class BeanPath implements Serializable{
|
|||||||
} else if (ArrayUtil.isArray(bean)) {
|
} else if (ArrayUtil.isArray(bean)) {
|
||||||
return ArrayUtil.getAny(bean, Convert.convert(int[].class, keys));
|
return ArrayUtil.getAny(bean, Convert.convert(int[].class, keys));
|
||||||
} else {
|
} else {
|
||||||
final String[] unwrapedKeys = new String[keys.size()];
|
final String[] unWrappedKeys = new String[keys.size()];
|
||||||
for (int i = 0; i < unwrapedKeys.length; i++) {
|
for (int i = 0; i < unWrappedKeys.length; i++) {
|
||||||
unwrapedKeys[i] = StrUtil.unWrap(keys.get(i), '\'');
|
unWrappedKeys[i] = StrUtil.unWrap(keys.get(i), '\'');
|
||||||
}
|
}
|
||||||
if (bean instanceof Map) {
|
if (bean instanceof Map) {
|
||||||
// 只支持String为key的Map
|
// 只支持String为key的Map
|
||||||
return MapUtil.getAny((Map<String, ?>) bean, unwrapedKeys);
|
return MapUtil.getAny((Map<String, ?>) bean, unWrappedKeys);
|
||||||
} else {
|
} else {
|
||||||
final Map<String, Object> map = BeanUtil.beanToMap(bean);
|
final Map<String, Object> map = BeanUtil.beanToMap(bean);
|
||||||
return MapUtil.getAny(map, unwrapedKeys);
|
return MapUtil.getAny(map, unWrappedKeys);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -632,6 +632,7 @@ public class DateUtil extends CalendarUtil {
|
|||||||
*
|
*
|
||||||
* @param date 被格式化的日期
|
* @param date 被格式化的日期
|
||||||
* @param isUppercase 是否采用大写形式
|
* @param isUppercase 是否采用大写形式
|
||||||
|
* @param withTime 是否包含时间部分
|
||||||
* @return 中文日期字符串
|
* @return 中文日期字符串
|
||||||
* @since 5.3.9
|
* @since 5.3.9
|
||||||
*/
|
*/
|
||||||
|
@ -21,7 +21,7 @@ import java.io.OutputStream;
|
|||||||
* e.addFrame(image2);
|
* e.addFrame(image2);
|
||||||
* e.finish();
|
* e.finish();
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
* <p>
|
||||||
* 来自:https://github.com/rtyley/animated-gif-lib-for-java
|
* 来自:https://github.com/rtyley/animated-gif-lib-for-java
|
||||||
*
|
*
|
||||||
* @author Kevin Weiner, FM Software
|
* @author Kevin Weiner, FM Software
|
||||||
@ -119,7 +119,8 @@ public class AnimatedGifEncoder {
|
|||||||
* closest one.
|
* closest one.
|
||||||
* May be set to null to indicate no transparent color.
|
* May be set to null to indicate no transparent color.
|
||||||
*
|
*
|
||||||
* @param c Color to be treated as transparent on display.
|
* @param c Color to be treated as transparent on display.
|
||||||
|
* @param exactMatch If exactMatch is set to true, transparent color index is search with exact match
|
||||||
*/
|
*/
|
||||||
public void setTransparent(Color c, boolean exactMatch) {
|
public void setTransparent(Color c, boolean exactMatch) {
|
||||||
transparent = c;
|
transparent = c;
|
||||||
@ -192,6 +193,8 @@ public class AnimatedGifEncoder {
|
|||||||
* Flushes any pending data and closes output file.
|
* Flushes any pending data and closes output file.
|
||||||
* If writing to an OutputStream, the stream is not
|
* If writing to an OutputStream, the stream is not
|
||||||
* closed.
|
* closed.
|
||||||
|
*
|
||||||
|
* @return is ok
|
||||||
*/
|
*/
|
||||||
public boolean finish() {
|
public boolean finish() {
|
||||||
if (!started) return false;
|
if (!started) return false;
|
||||||
@ -344,6 +347,9 @@ public class AnimatedGifEncoder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns index of palette color closest to c
|
* Returns index of palette color closest to c
|
||||||
|
*
|
||||||
|
* @param c Color
|
||||||
|
* @return index
|
||||||
*/
|
*/
|
||||||
protected int findClosest(Color c) {
|
protected int findClosest(Color c) {
|
||||||
if (colorTab == null) return -1;
|
if (colorTab == null) return -1;
|
||||||
@ -368,9 +374,13 @@ public class AnimatedGifEncoder {
|
|||||||
return minpos;
|
return minpos;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Returns true if the exact matching color is existing, and used in the color palette, otherwise, return false. This method has to be called before
|
* Returns true if the exact matching color is existing, and used in the color palette, otherwise, return false.
|
||||||
* finishing the image, because after finished the palette is destroyed and it will always return false.
|
* This method has to be called before finishing the image,
|
||||||
|
* because after finished the palette is destroyed and it will always return false.
|
||||||
|
*
|
||||||
|
* @param c 颜色
|
||||||
|
* @return 颜色是否存在
|
||||||
*/
|
*/
|
||||||
boolean isColorUsed(Color c) {
|
boolean isColorUsed(Color c) {
|
||||||
return findExact(c) != -1;
|
return findExact(c) != -1;
|
||||||
@ -378,6 +388,9 @@ public class AnimatedGifEncoder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns index of palette exactly matching to color c or -1 if there is no exact matching.
|
* Returns index of palette exactly matching to color c or -1 if there is no exact matching.
|
||||||
|
*
|
||||||
|
* @param c Color
|
||||||
|
* @return index
|
||||||
*/
|
*/
|
||||||
protected int findExact(Color c) {
|
protected int findExact(Color c) {
|
||||||
if (colorTab == null) {
|
if (colorTab == null) {
|
||||||
@ -422,6 +435,8 @@ public class AnimatedGifEncoder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes Graphic Control Extension
|
* Writes Graphic Control Extension
|
||||||
|
*
|
||||||
|
* @throws IOException IO异常
|
||||||
*/
|
*/
|
||||||
protected void writeGraphicCtrlExt() throws IOException {
|
protected void writeGraphicCtrlExt() throws IOException {
|
||||||
out.write(0x21); // extension introducer
|
out.write(0x21); // extension introducer
|
||||||
@ -454,6 +469,8 @@ public class AnimatedGifEncoder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes Image Descriptor
|
* Writes Image Descriptor
|
||||||
|
*
|
||||||
|
* @throws IOException IO异常
|
||||||
*/
|
*/
|
||||||
protected void writeImageDesc() throws IOException {
|
protected void writeImageDesc() throws IOException {
|
||||||
out.write(0x2c); // image separator
|
out.write(0x2c); // image separator
|
||||||
@ -478,6 +495,8 @@ public class AnimatedGifEncoder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes Logical Screen Descriptor
|
* Writes Logical Screen Descriptor
|
||||||
|
*
|
||||||
|
* @throws IOException IO异常
|
||||||
*/
|
*/
|
||||||
protected void writeLSD() throws IOException {
|
protected void writeLSD() throws IOException {
|
||||||
// logical screen size
|
// logical screen size
|
||||||
@ -497,6 +516,8 @@ public class AnimatedGifEncoder {
|
|||||||
/**
|
/**
|
||||||
* Writes Netscape application extension to define
|
* Writes Netscape application extension to define
|
||||||
* repeat count.
|
* repeat count.
|
||||||
|
*
|
||||||
|
* @throws IOException IO异常
|
||||||
*/
|
*/
|
||||||
protected void writeNetscapeExt() throws IOException {
|
protected void writeNetscapeExt() throws IOException {
|
||||||
out.write(0x21); // extension introducer
|
out.write(0x21); // extension introducer
|
||||||
@ -511,6 +532,8 @@ public class AnimatedGifEncoder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes color table
|
* Writes color table
|
||||||
|
*
|
||||||
|
* @throws IOException IO异常
|
||||||
*/
|
*/
|
||||||
protected void writePalette() throws IOException {
|
protected void writePalette() throws IOException {
|
||||||
out.write(colorTab, 0, colorTab.length);
|
out.write(colorTab, 0, colorTab.length);
|
||||||
@ -522,6 +545,8 @@ public class AnimatedGifEncoder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Encodes and writes pixel data
|
* Encodes and writes pixel data
|
||||||
|
*
|
||||||
|
* @throws IOException IO异常
|
||||||
*/
|
*/
|
||||||
protected void writePixels() throws IOException {
|
protected void writePixels() throws IOException {
|
||||||
LZWEncoder encoder = new LZWEncoder(width, height, indexedPixels, colorDepth);
|
LZWEncoder encoder = new LZWEncoder(width, height, indexedPixels, colorDepth);
|
||||||
@ -530,6 +555,9 @@ public class AnimatedGifEncoder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Write 16-bit value to output stream, LSB first
|
* Write 16-bit value to output stream, LSB first
|
||||||
|
*
|
||||||
|
* @param value 16-bit value
|
||||||
|
* @throws IOException IO异常
|
||||||
*/
|
*/
|
||||||
protected void writeShort(int value) throws IOException {
|
protected void writeShort(int value) throws IOException {
|
||||||
out.write(value & 0xff);
|
out.write(value & 0xff);
|
||||||
@ -538,6 +566,9 @@ public class AnimatedGifEncoder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes string to output stream
|
* Writes string to output stream
|
||||||
|
*
|
||||||
|
* @param s String
|
||||||
|
* @throws IOException IO异常
|
||||||
*/
|
*/
|
||||||
protected void writeString(String s) throws IOException {
|
protected void writeString(String s) throws IOException {
|
||||||
for (int i = 0; i < s.length(); i++) {
|
for (int i = 0; i < s.length(); i++) {
|
||||||
|
@ -19,7 +19,7 @@ import java.util.ArrayList;
|
|||||||
/**
|
/**
|
||||||
* GIF文件解析
|
* GIF文件解析
|
||||||
* Class GifDecoder - Decodes a GIF file into one or more frames.
|
* Class GifDecoder - Decodes a GIF file into one or more frames.
|
||||||
*
|
* <p>
|
||||||
* Example:
|
* Example:
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -34,7 +34,7 @@ import java.util.ArrayList;
|
|||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
* <p>
|
||||||
* 来自:https://github.com/rtyley/animated-gif-lib-for-java
|
* 来自:https://github.com/rtyley/animated-gif-lib-for-java
|
||||||
*
|
*
|
||||||
* @author Kevin Weiner, FM Software; LZW decoder adapted from John Cristy's ImageMagick.
|
* @author Kevin Weiner, FM Software; LZW decoder adapted from John Cristy's ImageMagick.
|
||||||
@ -112,6 +112,7 @@ public class GifDecoder {
|
|||||||
image = im;
|
image = im;
|
||||||
delay = del;
|
delay = del;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BufferedImage image;
|
public BufferedImage image;
|
||||||
public int delay;
|
public int delay;
|
||||||
}
|
}
|
||||||
@ -133,6 +134,7 @@ public class GifDecoder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the number of frames read from file.
|
* Gets the number of frames read from file.
|
||||||
|
*
|
||||||
* @return frame count
|
* @return frame count
|
||||||
*/
|
*/
|
||||||
public int getFrameCount() {
|
public int getFrameCount() {
|
||||||
@ -165,7 +167,7 @@ public class GifDecoder {
|
|||||||
protected void setPixels() {
|
protected void setPixels() {
|
||||||
// expose destination image's pixels as int array
|
// expose destination image's pixels as int array
|
||||||
int[] dest =
|
int[] dest =
|
||||||
((DataBufferInt) image.getRaster().getDataBuffer()).getData();
|
((DataBufferInt) image.getRaster().getDataBuffer()).getData();
|
||||||
|
|
||||||
// fill in starting image contents based on last image's dispose code
|
// fill in starting image contents based on last image's dispose code
|
||||||
if (lastDispose > 0) {
|
if (lastDispose > 0) {
|
||||||
@ -181,7 +183,7 @@ public class GifDecoder {
|
|||||||
|
|
||||||
if (lastImage != null) {
|
if (lastImage != null) {
|
||||||
int[] prev =
|
int[] prev =
|
||||||
((DataBufferInt) lastImage.getRaster().getDataBuffer()).getData();
|
((DataBufferInt) lastImage.getRaster().getDataBuffer()).getData();
|
||||||
System.arraycopy(prev, 0, dest, 0, width * height);
|
System.arraycopy(prev, 0, dest, 0, width * height);
|
||||||
// copy pixels
|
// copy pixels
|
||||||
|
|
||||||
@ -190,7 +192,7 @@ public class GifDecoder {
|
|||||||
Graphics2D g = image.createGraphics();
|
Graphics2D g = image.createGraphics();
|
||||||
Color c;
|
Color c;
|
||||||
if (transparency) {
|
if (transparency) {
|
||||||
c = new Color(0, 0, 0, 0); // assume background is transparent
|
c = new Color(0, 0, 0, 0); // assume background is transparent
|
||||||
} else {
|
} else {
|
||||||
c = new Color(lastBgColor); // use given background color
|
c = new Color(lastBgColor); // use given background color
|
||||||
}
|
}
|
||||||
@ -212,14 +214,14 @@ public class GifDecoder {
|
|||||||
if (iline >= ih) {
|
if (iline >= ih) {
|
||||||
pass++;
|
pass++;
|
||||||
switch (pass) {
|
switch (pass) {
|
||||||
case 2 :
|
case 2:
|
||||||
iline = 4;
|
iline = 4;
|
||||||
break;
|
break;
|
||||||
case 3 :
|
case 3:
|
||||||
iline = 2;
|
iline = 2;
|
||||||
inc = 4;
|
inc = 4;
|
||||||
break;
|
break;
|
||||||
case 4 :
|
case 4:
|
||||||
iline = 1;
|
iline = 1;
|
||||||
inc = 2;
|
inc = 2;
|
||||||
}
|
}
|
||||||
@ -252,7 +254,8 @@ public class GifDecoder {
|
|||||||
/**
|
/**
|
||||||
* Gets the image contents of frame n.
|
* Gets the image contents of frame n.
|
||||||
*
|
*
|
||||||
* @return BufferedImage representation of frame, or null if n is invalid.
|
* @param n frame
|
||||||
|
* @return BufferedImage
|
||||||
*/
|
*/
|
||||||
public BufferedImage getFrame(int n) {
|
public BufferedImage getFrame(int n) {
|
||||||
BufferedImage im = null;
|
BufferedImage im = null;
|
||||||
@ -322,7 +325,7 @@ public class GifDecoder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads GIF file from specified file/URL source
|
* Reads GIF file from specified file/URL source
|
||||||
* (URL assumed if name contains ":/" or "file:")
|
* (URL assumed if name contains ":/" or "file:")
|
||||||
*
|
*
|
||||||
* @param name String containing source
|
* @param name String containing source
|
||||||
@ -333,7 +336,7 @@ public class GifDecoder {
|
|||||||
try {
|
try {
|
||||||
name = name.trim().toLowerCase();
|
name = name.trim().toLowerCase();
|
||||||
if ((name.contains("file:")) ||
|
if ((name.contains("file:")) ||
|
||||||
(name.indexOf(":/") > 0)) {
|
(name.indexOf(":/") > 0)) {
|
||||||
URL url = new URL(name);
|
URL url = new URL(name);
|
||||||
in = new BufferedInputStream(url.openStream());
|
in = new BufferedInputStream(url.openStream());
|
||||||
} else {
|
} else {
|
||||||
@ -354,23 +357,23 @@ public class GifDecoder {
|
|||||||
protected void decodeImageData() {
|
protected void decodeImageData() {
|
||||||
int NullCode = -1;
|
int NullCode = -1;
|
||||||
int npix = iw * ih;
|
int npix = iw * ih;
|
||||||
int available,
|
int available,
|
||||||
clear,
|
clear,
|
||||||
code_mask,
|
code_mask,
|
||||||
code_size,
|
code_size,
|
||||||
end_of_information,
|
end_of_information,
|
||||||
in_code,
|
in_code,
|
||||||
old_code,
|
old_code,
|
||||||
bits,
|
bits,
|
||||||
code,
|
code,
|
||||||
count,
|
count,
|
||||||
i,
|
i,
|
||||||
datum,
|
datum,
|
||||||
data_size,
|
data_size,
|
||||||
first,
|
first,
|
||||||
top,
|
top,
|
||||||
bi,
|
bi,
|
||||||
pi;
|
pi;
|
||||||
|
|
||||||
if ((pixels == null) || (pixels.length < npix)) {
|
if ((pixels == null) || (pixels.length < npix)) {
|
||||||
pixels = new byte[npix]; // allocate new pixel array
|
pixels = new byte[npix]; // allocate new pixel array
|
||||||
@ -397,7 +400,7 @@ public class GifDecoder {
|
|||||||
|
|
||||||
datum = bits = count = first = top = pi = bi = 0;
|
datum = bits = count = first = top = pi = bi = 0;
|
||||||
|
|
||||||
for (i = 0; i < npix;) {
|
for (i = 0; i < npix; ) {
|
||||||
if (top == 0) {
|
if (top == 0) {
|
||||||
if (bits < code_size) {
|
if (bits < code_size) {
|
||||||
// Load bytes until there are enough bits for a code.
|
// Load bytes until there are enough bits for a code.
|
||||||
@ -461,7 +464,7 @@ public class GifDecoder {
|
|||||||
suffix[available] = (byte) first;
|
suffix[available] = (byte) first;
|
||||||
available++;
|
available++;
|
||||||
if (((available & code_mask) == 0)
|
if (((available & code_mask) == 0)
|
||||||
&& (available < MaxStackSize)) {
|
&& (available < MaxStackSize)) {
|
||||||
code_size++;
|
code_size++;
|
||||||
code_mask += available;
|
code_mask += available;
|
||||||
}
|
}
|
||||||
@ -483,6 +486,8 @@ public class GifDecoder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if an error was encountered during reading/decoding
|
* Returns true if an error was encountered during reading/decoding
|
||||||
|
*
|
||||||
|
* @return true if an error was encountered during reading/decoding
|
||||||
*/
|
*/
|
||||||
protected boolean err() {
|
protected boolean err() {
|
||||||
return status != STATUS_OK;
|
return status != STATUS_OK;
|
||||||
@ -501,6 +506,8 @@ public class GifDecoder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads a single byte from the input stream.
|
* Reads a single byte from the input stream.
|
||||||
|
*
|
||||||
|
* @return single byte
|
||||||
*/
|
*/
|
||||||
protected int read() {
|
protected int read() {
|
||||||
int curByte = 0;
|
int curByte = 0;
|
||||||
@ -525,7 +532,7 @@ public class GifDecoder {
|
|||||||
int count;
|
int count;
|
||||||
while (n < blockSize) {
|
while (n < blockSize) {
|
||||||
count = in.read(block, n, blockSize - n);
|
count = in.read(block, n, blockSize - n);
|
||||||
if (count == -1)
|
if (count == -1)
|
||||||
break;
|
break;
|
||||||
n += count;
|
n += count;
|
||||||
}
|
}
|
||||||
@ -582,18 +589,18 @@ public class GifDecoder {
|
|||||||
int code = read();
|
int code = read();
|
||||||
switch (code) {
|
switch (code) {
|
||||||
|
|
||||||
case 0x2C : // image separator
|
case 0x2C: // image separator
|
||||||
readImage();
|
readImage();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x21 : // extension
|
case 0x21: // extension
|
||||||
code = read();
|
code = read();
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case 0xf9 : // graphics control extension
|
case 0xf9: // graphics control extension
|
||||||
readGraphicControlExt();
|
readGraphicControlExt();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0xff : // application extension
|
case 0xff: // application extension
|
||||||
readBlock();
|
readBlock();
|
||||||
final StringBuilder app = new StringBuilder();
|
final StringBuilder app = new StringBuilder();
|
||||||
for (int i = 0; i < 11; i++) {
|
for (int i = 0; i < 11; i++) {
|
||||||
@ -601,24 +608,23 @@ public class GifDecoder {
|
|||||||
}
|
}
|
||||||
if (app.toString().equals("NETSCAPE2.0")) {
|
if (app.toString().equals("NETSCAPE2.0")) {
|
||||||
readNetscapeExt();
|
readNetscapeExt();
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
skip(); // don't care
|
skip(); // don't care
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default : // uninteresting extension
|
default: // uninteresting extension
|
||||||
skip();
|
skip();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x3b : // terminator
|
case 0x3b: // terminator
|
||||||
done = true;
|
done = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x00 : // bad byte, but keep going and see what happens
|
case 0x00: // bad byte, but keep going and see what happens
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default :
|
default:
|
||||||
status = STATUS_FORMAT_ERROR;
|
status = STATUS_FORMAT_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -705,7 +711,7 @@ public class GifDecoder {
|
|||||||
|
|
||||||
// create new image to receive frame data
|
// create new image to receive frame data
|
||||||
image =
|
image =
|
||||||
new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB_PRE);
|
new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB_PRE);
|
||||||
|
|
||||||
setPixels(); // transfer pixel data to image
|
setPixels(); // transfer pixel data to image
|
||||||
|
|
||||||
@ -755,6 +761,8 @@ public class GifDecoder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads next 16-bit value, LSB first
|
* Reads next 16-bit value, LSB first
|
||||||
|
*
|
||||||
|
* @return next 16-bit value
|
||||||
*/
|
*/
|
||||||
protected int readShort() {
|
protected int readShort() {
|
||||||
// read 16-bit value, LSB first
|
// read 16-bit value, LSB first
|
||||||
|
@ -4,6 +4,7 @@ import cn.hutool.core.annotation.Alias;
|
|||||||
import cn.hutool.core.bean.copier.CopyOptions;
|
import cn.hutool.core.bean.copier.CopyOptions;
|
||||||
import cn.hutool.core.bean.copier.ValueProvider;
|
import cn.hutool.core.bean.copier.ValueProvider;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.lang.Console;
|
||||||
import cn.hutool.core.map.MapUtil;
|
import cn.hutool.core.map.MapUtil;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@ -404,4 +405,11 @@ public class BeanUtilTest {
|
|||||||
@Alias("code")
|
@Alias("code")
|
||||||
private String code2;
|
private String code2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void setPropertiesTest(){
|
||||||
|
Map<String, Object> resultMap = MapUtil.newHashMap();
|
||||||
|
BeanUtil.setProperty(resultMap, "codeList[0].name", "张三");
|
||||||
|
Console.log(resultMap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,12 @@ public class LocalDateTimeUtilTest {
|
|||||||
Assert.assertEquals("2020-01-23T12:23:56", localDateTime.toString());
|
Assert.assertEquals("2020-01-23T12:23:56", localDateTime.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void parseTest5() {
|
||||||
|
final LocalDateTime localDateTime = LocalDateTimeUtil.parse("2020-01-23T12:23:56");
|
||||||
|
Assert.assertEquals("2020-01-23T12:23:56", localDateTime.toString());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void formatTest() {
|
public void formatTest() {
|
||||||
final LocalDateTime localDateTime = LocalDateTimeUtil.parse("2020-01-23T12:23:56");
|
final LocalDateTime localDateTime = LocalDateTimeUtil.parse("2020-01-23T12:23:56");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user