cdc.mf.model.MfMember Maven / Gradle / Ivy
The newest version!
package cdc.mf.model;
/**
* Base interface of members:
*
* - {@link MfOperation operations}
*
- {@link MfProperty properties}
*
*
* @author Damien Carbonne
*/
public abstract class MfMember extends MfAbstractBasicElement
implements MfDependencyOwner, MfModifierItem, MfPackagedItem {
private final MfVisibility visibility;
private final boolean isStatic;
private final boolean isFinal;
protected MfMember(Builder, ?, ? extends MfMemberOwner> builder,
MfElementFeatures features) {
super(builder, features);
this.visibility = builder.visibility;
this.isStatic = builder.isStatic;
this.isFinal = builder.isFinal;
}
@Override
public MfVisibility getVisibility() {
return visibility;
}
@Override
public boolean isStatic() {
return isStatic;
}
@Override
public boolean isFinal() {
return isFinal;
}
public abstract static class Builder,
E extends MfMember,
P extends MfMemberOwner>
extends MfAbstractBasicElement.Builder {
private MfVisibility visibility;
private boolean isStatic = false;
private boolean isFinal = false;
protected Builder(P parent) {
super(parent);
}
@Override
public B set(E element) {
return super.set(element).visibility(element.getVisibility())
.isStatic(element.isStatic())
.isFinal(element.isFinal());
}
public final MfVisibility getVisibility() {
return visibility;
}
public B visibility(MfVisibility visibility) {
this.visibility = visibility;
return self();
}
public final boolean isStatic() {
return isStatic;
}
public B isStatic(boolean isStatic) {
this.isStatic = isStatic;
return self();
}
public final boolean isFinal() {
return isFinal;
}
public B isFinal(boolean isFinal) {
this.isFinal = isFinal;
return self();
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy