class CacheEntryInfoCollection implements Message {
    /** */
    private static final long serialVersionUID = 0L;

    /** */
    @GridDirectCollection(GridCacheEntryInfo.class)
    private List<GridCacheEntryInfo> infos;

    /** */
    public CacheEntryInfoCollection() {
        // No-op
    }

    /**
     * @param infos List of cache entry info.
     */
    public CacheEntryInfoCollection(List<GridCacheEntryInfo> infos) {
        this.infos = infos;
    }

    /**
     *
     */
    public void init() {
        infos = new ArrayList<>();
    }

    /**
     * @return Entries.
     */
    public List<GridCacheEntryInfo> infos() {
        return infos;
    }

    /**
     * @param info Entry.
     */
    public void add(GridCacheEntryInfo info) {
        infos.add(info);
    }

    /** {@inheritDoc} */
    @Override public void onAckReceived() {
        // No-op.
    }

    /** {@inheritDoc} */
    @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) {<FILL_FUNCTION_BODY>}

    /** {@inheritDoc} */
    @Override public boolean readFrom(ByteBuffer buf, MessageReader reader) {
        reader.setBuffer(buf);

        if (!reader.beforeMessageRead())
            return false;

        switch (reader.state()) {
            case 0:
                infos = reader.readCollection("infos", MessageCollectionItemType.MSG);

                if (!reader.isLastRead())
                    return false;

                reader.incrementState();

        }

        return reader.afterMessageRead(CacheEntryInfoCollection.class);
    }

    /** {@inheritDoc} */
    @Override public short directType() {
        return 92;
    }

    /** {@inheritDoc} */
    @Override public byte fieldsCount() {
        return 1;
    }

    /** {@inheritDoc} */
    @Override public String toString() {
        StringBuilder b = new StringBuilder();
        b.append("[");

        for (int i = 0; i < infos().size(); i++) {
            GridCacheEntryInfo info = infos().get(i);

            Object k = info.key().value(null, false);

            b.append("[key=").append(k == null ? "null" : k).append(", ver=").
                append(info.version()).append(", val=").append(info.value()).append(']');
        }

        b.append(']');

        return b.toString();
    }
}

        writer.setBuffer(buf);

        if (!writer.isHeaderWritten()) {
            if (!writer.writeHeader(directType(), fieldsCount()))
                return false;

            writer.onHeaderWritten();
        }

        switch (writer.state()) {
            case 0:
                if (!writer.writeCollection("infos", infos, MessageCollectionItemType.MSG))
                    return false;

                writer.incrementState();

        }

        return true;
    
<no_super_class>