All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.lontime.shaded.org.redisson.api.StreamInfo Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (c) 2013-2021 Nikita Koksharov
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.lontime.shaded.org.redisson.api;

import java.util.Map;

/**
 * Object containing details about Stream
 * 
 * @author Nikita Koksharov
 *
 * @param  key type
 * @param  value type
 */
public class StreamInfo {

    public static class Entry {
        
        final StreamMessageId id;
        final Map data;
        
        public Entry(StreamMessageId id, Map data) {
            this.id = id;
            this.data = data;
        }
        
        /**
         * Returns StreamMessageId of this stream entry.
         * 
         * @return StreamMessageId object
         */
        public StreamMessageId getId() {
            return id;
        }

        /**
         * Returns data stored in this stream entry
         * 
         * @return Map object
         */
        public Map getData() {
            return data;
        }
        
    }
    
    int length;
    int radixTreeKeys;
    int radixTreeNodes;
    int groups;
    StreamMessageId lastGeneratedId;
    Entry firstEntry;
    Entry lastEntry;
    
    /**
     * Returns length of the stream
     * 
     * @return length of the stream
     */
    public int getLength() {
        return length;
    }
    public void setLength(int length) {
        this.length = length;
    }
    
    /**
     * Returns amount of keys allocated by Radix tree of the stream.
     * 
     * @return amount of keys
     */
    public int getRadixTreeKeys() {
        return radixTreeKeys;
    }
    public void setRadixTreeKeys(int radixTreeKeys) {
        this.radixTreeKeys = radixTreeKeys;
    }
    
    /**
     * Returns amount of nodes allocated by Radix tree of the stream.
     * 
     * @return amount of nodes
     */
    public int getRadixTreeNodes() {
        return radixTreeNodes;
    }
    public void setRadixTreeNodes(int radixTreeNodes) {
        this.radixTreeNodes = radixTreeNodes;
    }
    
    /**
     * Returns amount of groups belonging to the stream
     * 
     * @return amount of groups
     */
    public int getGroups() {
        return groups;
    }
    public void setGroups(int groups) {
        this.groups = groups;
    }
    
    /**
     * Returns last StreamMessageId used by the stream
     * 
     * @return StreamMessageId object
     */
    public StreamMessageId getLastGeneratedId() {
        return lastGeneratedId;
    }
    public void setLastGeneratedId(StreamMessageId lastGeneratedId) {
        this.lastGeneratedId = lastGeneratedId;
    }
    
    /**
     * Returns first stream entry
     * 
     * @return stream entry
     */
    public Entry getFirstEntry() {
        return firstEntry;
    }
    public void setFirstEntry(Entry firstEntry) {
        this.firstEntry = firstEntry;
    }

    /**
     * Returns last stream entry
     * 
     * @return stream entry
     */
    public Entry getLastEntry() {
        return lastEntry;
    }
    public void setLastEntry(Entry lastEntry) {
        this.lastEntry = lastEntry;
    }
    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy