MergedMultiResource.java 1.11 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  org.apache.sling.api.resource.Resource
 *  org.apache.sling.api.resource.ResourceResolver
 *  org.apache.sling.api.resource.SyntheticResource
 *  org.apache.sling.api.resource.ValueMap
 */
package com.day.cq.wcm.foundation.forms;

import com.day.cq.wcm.foundation.forms.MergedValueMap;
import java.util.List;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.resource.SyntheticResource;
import org.apache.sling.api.resource.ValueMap;

public class MergedMultiResource
extends SyntheticResource {
    private List<Resource> resources;

    public MergedMultiResource(List<Resource> resources) {
        super(resources.get(0).getResourceResolver(), resources.get(0).getPath() + "#multiresource", "cq/multiresource");
        this.resources = resources;
    }

    public <AdapterType> AdapterType adaptTo(Class<AdapterType> type) {
        if (type == ValueMap.class) {
            return (AdapterType)new MergedValueMap(this.resources);
        }
        return null;
    }
}