Search in sources :

Example 1 with RatingSpec

use of com.icthh.xm.ms.entity.domain.spec.RatingSpec in project xm-ms-entity by xm-online.

the class XmEntitySpecService method getAllKeys.

/**
 * Transforms all XmEntity Specification keys into the thin structure based
 * in maps and sets.
 *
 * @return thin structure based in maps and sets
 */
@IgnoreLogginAspect
public Map<String, Map<String, Set<String>>> getAllKeys() {
    Map<String, Map<String, Set<String>>> result = Maps.newHashMap();
    for (TypeSpec typeSpec : findAllTypes()) {
        Map<String, Set<String>> subKeys = Maps.newHashMap();
        getKeys(subKeys, AttachmentSpec.class, typeSpec.getAttachments(), AttachmentSpec::getKey);
        getKeys(subKeys, CalendarSpec.class, typeSpec.getCalendars(), CalendarSpec::getKey);
        getKeys(subKeys, LinkSpec.class, typeSpec.getLinks(), LinkSpec::getKey);
        getKeys(subKeys, LocationSpec.class, typeSpec.getLocations(), LocationSpec::getKey);
        getKeys(subKeys, RatingSpec.class, typeSpec.getRatings(), RatingSpec::getKey);
        getKeys(subKeys, StateSpec.class, typeSpec.getStates(), StateSpec::getKey);
        getKeys(subKeys, TagSpec.class, typeSpec.getTags(), TagSpec::getKey);
        result.put(typeSpec.getKey(), subKeys);
    }
    return result;
}
Also used : AttachmentSpec(com.icthh.xm.ms.entity.domain.spec.AttachmentSpec) LocationSpec(com.icthh.xm.ms.entity.domain.spec.LocationSpec) Set(java.util.Set) RatingSpec(com.icthh.xm.ms.entity.domain.spec.RatingSpec) StateSpec(com.icthh.xm.ms.entity.domain.spec.StateSpec) TagSpec(com.icthh.xm.ms.entity.domain.spec.TagSpec) LinkSpec(com.icthh.xm.ms.entity.domain.spec.LinkSpec) CalendarSpec(com.icthh.xm.ms.entity.domain.spec.CalendarSpec) Map(java.util.Map) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) TypeSpec(com.icthh.xm.ms.entity.domain.spec.TypeSpec) IgnoreLogginAspect(com.icthh.xm.commons.logging.aop.IgnoreLogginAspect)

Aggregations

IgnoreLogginAspect (com.icthh.xm.commons.logging.aop.IgnoreLogginAspect)1 AttachmentSpec (com.icthh.xm.ms.entity.domain.spec.AttachmentSpec)1 CalendarSpec (com.icthh.xm.ms.entity.domain.spec.CalendarSpec)1 LinkSpec (com.icthh.xm.ms.entity.domain.spec.LinkSpec)1 LocationSpec (com.icthh.xm.ms.entity.domain.spec.LocationSpec)1 RatingSpec (com.icthh.xm.ms.entity.domain.spec.RatingSpec)1 StateSpec (com.icthh.xm.ms.entity.domain.spec.StateSpec)1 TagSpec (com.icthh.xm.ms.entity.domain.spec.TagSpec)1 TypeSpec (com.icthh.xm.ms.entity.domain.spec.TypeSpec)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 Set (java.util.Set)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1