Reference.java 1.33 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  aQute.bnd.annotation.ConsumerType
 *  org.apache.sling.api.resource.Resource
 */
package com.adobe.granite.references;

import aQute.bnd.annotation.ConsumerType;
import org.apache.sling.api.resource.Resource;

@ConsumerType
public class Reference {
    private final Resource source;
    private final Resource target;
    private final String type;

    public Reference(Resource source, Resource target, String type) {
        this.source = source;
        this.target = target;
        this.type = type;
    }

    public Resource getSource() {
        return this.source;
    }

    public Resource getTarget() {
        return this.target;
    }

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

    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("Reference => {\n");
        sb.append("\tsource: ").append(this.getSource() != null ? this.getSource().getPath() : null).append("\n");
        sb.append("\ttarget: ").append(this.getTarget() != null ? this.getTarget().getPath() : null).append("\n");
        sb.append("\ttype: ").append(this.getType()).append("\n");
        sb.append("\tclass: ").append(this.getClass().getCanonicalName()).append("\n");
        sb.append("}\n");
        return sb.toString();
    }
}