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

cdc.mf.model.MfAssociation Maven / Gradle / Ivy

The newest version!
package cdc.mf.model;

import cdc.util.lang.Introspection;

/**
 * Association class.
 *
 * @author Damien Carbonne
 */
public final class MfAssociation extends MfConnector {
    public static final Class PARENT_CLASS =
            MfConnectorOwner.class;
    public static final Class> BUILDER_CLASS =
            Introspection.uncheckedCast(Builder.class);

    protected MfAssociation(Builder builder) {
        super(builder);

        addToParent(FEATURES);
        addToModel();
    }

    @Override
    public MfAssociation duplicate(MfConnectorOwner tgtParent) {
        return tgtParent.association().set(this).build();
    }

    @Override
    public MfDocumentation.Builder documentation() {
        return MfDocumentation.builder(this);
    }

    @Override
    public MfTag.Builder tag() {
        return MfTag.builder(this);
    }

    @Override
    public MfDependency.Builder dependency() {
        return MfDependency.builder(this);
    }

    @Override
    public MfTip.Builder source() {
        return MfTip.builder(this, MfTipSide.SOURCE);
    }

    @Override
    public MfTip.Builder target() {
        return MfTip.builder(this, MfTipSide.TARGET);
    }

    @Override
    public MfTip.Builder tip(MfTipSide side) {
        return side == MfTipSide.SOURCE ? source() : target();
    }

    @Override
    public MfConstraint.Builder constraint() {
        return MfConstraint.builder(this);
    }

    static 

Builder

builder(P parent) { return new Builder<>(parent); } /** * Builder of associations. * * @author Damien Carbonne * * @param

The concrete parent type. */ public static final class Builder

extends MfConnector.Builder, MfAssociation, P> { protected Builder(P parent) { super(parent); } @Override public Class getElementClass() { return MfAssociation.class; } @Override public MfAssociation build() { return new MfAssociation(this); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy