cdc.mf.model.MfParameterOwner Maven / Gradle / Ivy
The newest version!
package cdc.mf.model;
import java.util.List;
/**
* Interface of elements that can own {@link MfParameter parameters}.
*
* @author Damien Carbonne
*/
public interface MfParameterOwner extends MfNameItem {
/**
* @return The {@link MfParameter parameters} owned by this element.
*/
public default List getParameters() {
return getChildren(MfParameter.class);
}
/**
* @param direction The direction.
* @return The {@link MfParameter parameters} owned by this element and that have {@code direction}.
*/
public default List getParameters(MfParameterDirection direction) {
return getChildren(MfParameter.class, x -> x.getDirection() == direction);
}
public default List getSignatureParameters() {
return getChildren(MfParameter.class, x -> x.getDirection() != MfParameterDirection.RETURN);
}
public default List getReturnParameters() {
return getParameters(MfParameterDirection.RETURN);
}
/**
* @return {@code true} if this element owns {@link MfParameter parameters}.
*/
public default boolean hasParameters() {
return hasChildren(MfParameter.class);
}
/**
* @return A {@link MfParameter parameter} {@link MfParameter.Builder builder}.
*/
public MfParameter.Builder extends MfParameterOwner> parameter();
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy