public boolean isValid()

in src/main/java/com/aliyun/openservices/log/common/SubStore.java [33:55]


    public boolean isValid() {
        if (this.sortedKeyCount <= 0 || this.sortedKeyCount >= this.keys.size()) {
            return false;
        }
        if (this.timeIndex >= this.keys.size() || this.timeIndex < this.sortedKeyCount) {
            return false;
        }
        if (this.ttl <= 0 || this.ttl > 3650) {
            return false;
        }
        for (int i = 0; i < this.keys.size(); i++) {
            if (!this.keys.get(i).isValid()) {
                return false;
            }
            if (i == this.timeIndex && !"long".equals(this.keys.get(i).getType())) {
                return false;
            }
            if (i < this.sortedKeyCount && "double".equals(this.keys.get(i).getType())) {
                return false;
            }
        }
        return true;
    }