Paragraph.java 2.36 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.day.cq.commons.DiffInfo
 *  com.day.cq.commons.DiffInfo$TYPE
 *  org.apache.sling.api.resource.Resource
 *  org.apache.sling.api.resource.ResourceWrapper
 */
package com.day.cq.wcm.foundation;

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

public class Paragraph
extends ResourceWrapper {
    private final Type type;
    private final int colNr;
    private final int numCols;
    private final String cssClass;
    private com.day.cq.commons.DiffInfo diffInfo;

    protected Paragraph(Resource resource, Type type, int colNr, String cssClass, int numCols) {
        super(resource);
        this.type = type;
        this.colNr = colNr;
        this.cssClass = cssClass;
        this.numCols = numCols;
    }

    protected Paragraph(Resource resource, Type type) {
        this(resource, type, 0, "", 0);
    }

    public Type getType() {
        return this.type;
    }

    public int getColNr() {
        return this.colNr;
    }

    public int getNumCols() {
        return this.numCols;
    }

    public String getBaseCssClass() {
        return this.cssClass;
    }

    public String getCssClass() {
        return this.cssClass + "-c" + this.colNr;
    }

    public void setDiffInfo(com.day.cq.commons.DiffInfo di) {
        this.diffInfo = di;
    }

    public <AdapterType> AdapterType adaptTo(Class<AdapterType> type) {
        if (type == com.day.cq.commons.DiffInfo.class) {
            return (AdapterType)this.diffInfo;
        }
        if (type == DiffInfo.class) {
            return (AdapterType)((Object)(this.diffInfo == null ? null : new DiffInfo(this.diffInfo.getContent(), this.diffInfo.getType())));
        }
        return (AdapterType)super.adaptTo(type);
    }

    public String toString() {
        return this.getClass().getSimpleName() + ", path=" + this.getPath() + ", type=" + this.getResourceType() + ", cssClass=" + this.getBaseCssClass() + ", column=" + this.getColNr() + "/" + this.getNumCols() + ", diffInfo=[" + (Object)this.diffInfo + "]" + ", resource=[" + (Object)this.getResource() + "]";
    }

    public static enum Type {
        NORMAL,
        START,
        BREAK,
        END;
        

        private Type() {
        }
    }

}