当我从Spring Boot应用程序访问/ health端点时,它返回UP状态:
{
"status": "UP"
}
Run Code Online (Sandbox Code Playgroud)
但我想自定义我的状态:
{
"status": "success"
}
Run Code Online (Sandbox Code Playgroud)
我该如何自定义状态?
在我的应用程序中包含一个数组列表,我每分钟都在添加值。
最初,我想为该数组列表添加一个值数千次,因为我的代码是
int count = 30000; Arraylist mylist = new Arraylist();for(int i=0;i<count;i++)
{
mylist.add("4.5");
}
Run Code Online (Sandbox Code Playgroud)
在上面的代码中,完成 for 循环需要很长时间,而且我的应用程序变得很慢。是否有其他方法可以一键快速将值添加到数组列表?
我试图在java中的整数列表中洗牌.我尝试使用以下方法,但它没有被洗牌.
List<Integer> dataList1 = new ArrayList<Integer>();
//adding values to list
Collections.shuffle(Arrays.asList(dataList1));
Run Code Online (Sandbox Code Playgroud)
我哪里错了?