提交 2f5d779d 编写于 作者: B Blankj

see 08/15 log

上级 8a6976d3
......@@ -42,7 +42,7 @@
## 打个小广告
欢迎加入我的知识星球「**[基你太美](https://t.zsxq.com/FmeqfYF)**学习 [AucFrame](https://blankj.com/2019/07/22/auc-frame/) 框架,目前一期内测已结束,二期已开,有兴趣进群的可以加我微信(备注:基你太美二期)。
欢迎加入我的知识星球「**[基你太美](https://t.zsxq.com/FmeqfYF)**,我会在星球中分享 [AucFrame](https://blankj.com/2019/07/22/auc-frame/) 框架、大厂面经、[AndroidUtilCode](https://github.com/Blankj/AndroidUtilCode) 更详尽的说明...一切我所了解的知识,你可以通过支付进入我的星球「**[基你太美](https://t.zsxq.com/FmeqfYF)**」进行体验,加入后优先观看星球中精华的部分,如果觉得星球的内容对自身没有收益,你可以自行申请退款退出星球,也没必要加我好友;**如果你已确定要留在我的星球,可以通过扫描如下二维码(备注:基你太美)加我个人微信,向我发送你的星球 ID,方便我后续拉你进群(PS:进得越早价格越便宜)。**
![我的二维码](https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/wechat.png)
......
......@@ -628,7 +628,7 @@ isEmpty : 判断 Map 是否为空
isNotEmpty : 判断 Map 是否非空
size : 获取 Map 元素个数
forAllDo : 对所有元素做操作
transform : 对集合做转变
transform : 对 Map 做转变
toString : Map 转为字符串
```
......
......@@ -32,39 +32,39 @@ public class ArrayUtils {
*/
@SafeVarargs
public static <T> T[] newArray(T... array) {
return copy(array);
return array;
}
public static long[] newLongArray(long... array) {
return copy(array);
return array;
}
public static int[] newIntArray(int... array) {
return copy(array);
return array;
}
public static short[] newShortArray(short... array) {
return copy(array);
return array;
}
public static char[] newCharArray(char... array) {
return copy(array);
return array;
}
public static byte[] newByteArray(byte... array) {
return copy(array);
return array;
}
public static double[] newDoubleArray(double... array) {
return copy(array);
return array;
}
public static float[] newFloatArray(float... array) {
return copy(array);
return array;
}
public static boolean[] newBooleanArray(boolean... array) {
return copy(array);
return array;
}
/**
......
package com.blankj.utilcode.util;
import android.support.annotation.NonNull;
import android.util.Pair;
import java.util.Collections;
......@@ -64,8 +63,11 @@ public class MapUtils {
}
@SafeVarargs
public static <K, V> TreeMap<K, V> newTreeMap(@NonNull final Comparator<K> comparator,
public static <K, V> TreeMap<K, V> newTreeMap(final Comparator<K> comparator,
final Pair<K, V>... pairs) {
if (comparator == null) {
throw new IllegalArgumentException("comparator must not be null");
}
TreeMap<K, V> map = new TreeMap<>(comparator);
if (pairs == null || pairs.length == 0) {
return map;
......
......@@ -53,7 +53,6 @@ public class ArrayUtilsTest extends BaseTest {
Object emptyArr1 = new int[]{};
Assert.assertTrue(ArrayUtils.isSameLength(null, emptyArr1));
Assert.assertTrue(ArrayUtils.isSameLength(new boolean[0], emptyArr1));
}
@Test
......@@ -188,6 +187,10 @@ public class ArrayUtilsTest extends BaseTest {
List<Integer> list = ArrayUtils.asList(1, 2, 3, 4);
System.out.println(list);
List<Integer> list1 = ArrayUtils.asUnmodifiableList(1, 2, 3, 4);
list1.set(0,2);
System.out.println(list1);
}
@Test
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册