DiffedResourceWrapper.java 790 Bytes
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  org.apache.sling.api.resource.Resource
 *  org.apache.sling.api.resource.ResourceWrapper
 */
package com.day.cq.commons.impl;

import com.day.cq.commons.DiffInfo;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceWrapper;

public class DiffedResourceWrapper
extends ResourceWrapper {
    private final DiffInfo info;

    public DiffedResourceWrapper(Resource resource, DiffInfo info) {
        super(resource);
        this.info = info;
    }

    public <AdapterType> AdapterType adaptTo(Class<AdapterType> type) {
        if (type == DiffInfo.class) {
            return (AdapterType)this.info;
        }
        return (AdapterType)super.adaptTo(type);
    }
}