<commit_before>package de.oneos.projections

import org.apache.commons.logging.*

class Depository<T> {
    static Log log = LogFactory.getLog(Depository)


    Map<UUID, Resource<T>> cache = [:]

    void put(Resource<T> r) {
        if(r.aggregateId != null) {
            log.debug "Resource ${r.body.getClass().simpleName}#{$r.aggregateId} is updated"
            cache[r.aggregateId] = r
        }
    }

    boolean contains(UUID k) {
        return cache.containsKey(k)
    }

    Resource<T> get(UUID k) {
        return getAt(k)
    }

    Resource<T> getAt(UUID k) {
        return cache[k]
    }

    Collection<Resource<T>> getAll() {
        return cache.values()
    }<commit_msg>Added short hand methods to Depository<commit_after>package de.oneos.projections

import org.apache.commons.logging.*

class Depository<T> {
    static Log log = LogFactory.getLog(Depository)


    Map<UUID, Resource<T>> cache = [:]

    void put(Resource<T> r) {
        if(r.aggregateId != null) {
            log.debug "Resource ${r.body.getClass().simpleName}#{$r.aggregateId} is updated"
            cache[r.aggregateId] = r
        }
    }

    boolean contains(UUID k) {
        return cache.containsKey(k)
    }

    Resource<T> get(UUID k) {
        return getAt(k)
    }

    Resource<T> getAt(UUID k) {
        return cache[k]
    }

    Collection<T> getAllBodies() {
        return getAll()*.body
    }

    Collection<Resource<T>> getAll() {
        return cache.values()
    }
{'fraction_non_alphanumeric': 0.13198653198653199, 'fraction_numerical': 0.0, 'mean_word_length': 2.3619909502262444, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '16127', 'n_tokens_mistral': 506, 'n_tokens_neox': 488, 'n_words': 97}