cdc.mf.model.MfAggregation Maven / Gradle / Ivy
The newest version!
package cdc.mf.model;
import cdc.util.lang.Introspection;
/**
* Aggregation class.
*
* @author Damien Carbonne
*/
public final class MfAggregation extends MfConnector {
public static final Class PARENT_CLASS =
MfConnectorOwner.class;
public static final Class> BUILDER_CLASS =
Introspection.uncheckedCast(Builder.class);
protected MfAggregation(Builder extends MfConnectorOwner> builder) {
super(builder);
addToParent(FEATURES);
addToModel();
}
public MfTip getWholeTip() {
return getSourceTip();
}
public MfTip getPartTip() {
return getTargetTip();
}
@Override
public MfAggregation duplicate(MfConnectorOwner tgtParent) {
return tgtParent.aggregation().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 aggregations.
*
* @author Damien Carbonne
*
* @param
The concrete parent type.
*/
public static class Builder
extends MfConnector.Builder, MfAggregation, P> {
protected Builder(P parent) {
super(parent);
}
@Override
public Class getElementClass() {
return MfAggregation.class;
}
@Override
public MfAggregation build() {
return new MfAggregation(this);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy