Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/374.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Hazelcast无法对IList进行排序_Java_List_Hazelcast - Fatal编程技术网

Java Hazelcast无法对IList进行排序

Java Hazelcast无法对IList进行排序,java,list,hazelcast,Java,List,Hazelcast,我正在尝试使用以下代码对Hazelcast IList进行排序 类付费频道条目 public class PaymentChannelEntry implements Serializable { private static final long serialVersionUID = 5416475057971472127L; private Long executionTimestamp; // timestamp of the time of the transactio

我正在尝试使用以下代码对Hazelcast IList进行排序

类付费频道条目

public class PaymentChannelEntry implements Serializable {

    private static final long serialVersionUID = 5416475057971472127L;
    private Long executionTimestamp; // timestamp of the time of the transaction in Zulu time zone (UTC)
    private BigDecimal transactionAmount; // The amount of the transaction that contributes to the associated payment channel

    public PaymentChannelEntry(Long executionTimestamp, BigDecimal transactionAmount) {
        this.executionTimestamp = executionTimestamp;
        this.transactionAmount = transactionAmount;
    }

    public Long getExecutionTimestamp() {
        return executionTimestamp;
    }

    public void setExecutionTimestamp(Long executionTimestamp) {
        this.executionTimestamp = executionTimestamp;
    }

    public BigDecimal getTransactionAmount() {
        return transactionAmount;
    }

    public void setTransactionAmount(BigDecimal transactionAmount) {
        this.transactionAmount = transactionAmount;
    }
}
然后我从Hazelcast IList中选择PaymentChannelEntry列表

IList<PaymentChannelEntry> entryIList = channelStore.getChannelEntryList(channelData.getType())
任何解决方案都将不胜感激


谢谢。

似乎是由
channelStore返回的列表。getChannelEntryList
不可修改,因此出现异常

如果无法修改返回的内容,请先复制,然后排序:

// example
IList<PaymentChannelEntry> result = new ArrayList<>(channelStore.getChannelEntryList(channelData.getType()));    
// now sort the list
//示例
IList result=newArrayList(channelStore.getChannelEntryList(channelData.getType());
//现在对列表进行排序
以上只是一个示例,可能无法编译,但最终需要将从
channelStore.getChannelEntryList(channelData.getType())
返回的内容复制到一个可变列表中,然后对其进行排序

// example
IList<PaymentChannelEntry> result = new ArrayList<>(channelStore.getChannelEntryList(channelData.getType()));    
// now sort the list