All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.apicurio.datamodels.asyncapi.models.AaiCorrelationId Maven / Gradle / Ivy

package io.apicurio.datamodels.asyncapi.models;

import io.apicurio.datamodels.asyncapi.visitors.IAaiVisitor;
import io.apicurio.datamodels.core.models.ExtensibleNode;
import io.apicurio.datamodels.core.models.IReferenceNode;
import io.apicurio.datamodels.core.models.Node;
import io.apicurio.datamodels.core.models.common.INamed;
import io.apicurio.datamodels.core.visitors.IVisitor;

/**
 * @author Jakub Senko 
 */
public abstract class AaiCorrelationId extends ExtensibleNode implements IReferenceNode, INamed {

    public String _name;
    public String $ref;
    public String location;
    public String description;
    
    /**
     * Constructor.
     */
    public AaiCorrelationId(String name) {
        this._name = name;
    }

    public AaiCorrelationId(Node parent) {
        if(parent != null) {
            this._parent = parent;
            this._ownerDocument = parent.ownerDocument();
        }
    }

    public AaiCorrelationId(Node parent, String name) {
        this(parent);
        this._name = name;
    }

    @Override
    public void accept(IVisitor visitor) {
        IAaiVisitor v = (IAaiVisitor) visitor;
        v.visitCorrelationId(this);
    }
    
    /**
     * @see io.apicurio.datamodels.core.models.common.INamed#getName()
     */
    @Override
    public String getName() {
        return this._name;
    }
    
    /**
     * @see io.apicurio.datamodels.core.models.common.INamed#rename(java.lang.String)
     */
    @Override
    public void rename(String newName) {
        this._name = newName;
    }

    @Override
    public String getReference() {
        return $ref;
    }

    @Override
    public void setReference(String reference) {
        $ref = reference;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy