我有一个List名称availableSeats我正在通过blockIndex属性进行排序和分组,如下所示:
availableSeats.stream()
.sorted(Comparator.comparing(SeatedTicketAssignment::getBlockIndex))
.collect(Collectors.groupingBy(SeatedTicketAssignment::getBlockIndex))
.forEach((block, blockAssignments) -> {
//Rest of the code
}
Run Code Online (Sandbox Code Playgroud)
问题是分组的结果不是由blockIndex排序的.
有没有办法在AWS上临时配置我的Redis实例,以便可以从AWS外部公开访问,这样我就可以通过Redis桌面管理器在本地连接它,或者在调试应用程序时只需更改spring的活动配置文件,这样我就可以使用实时数据进行本地调试?
谢谢.
我有一个方法如下
private void RegisterServices(IServiceCollection serviceCollection, Container container, string solutionPrefix)
{
var types = AppDomain.CurrentDomain.GetAssemblies()
.Where(a.FullName.StartsWith(solutionPrefix))
.SelectMany(x => x.GetTypes())
.Where(x => !x.IsAbstract && !x.IsGenericTypeDefinition);
//Rest of the code...
}
Run Code Online (Sandbox Code Playgroud)
现在我想以一种方式重构代码,使solutionPrefix参数是一个字符串数组,在第一个Where子句中,它选择其名称以solutionPrefix数组中的任何项开头的所有程序集.