io.sphere.sdk.expansion.ExpansionDslUtil Maven / Gradle / Ivy
package io.sphere.sdk.expansion;
import java.util.Collections;
import java.util.List;
import java.util.function.Function;
import static io.sphere.sdk.utils.ListUtils.listOf;
public final class ExpansionDslUtil {
private ExpansionDslUtil() {
}
public static C plusExpansionPaths(final MetaModelExpansionDslExpansionModelRead meta, final Function> m) {
return meta.plusExpansionPaths(m.apply(meta.expansionModel()).expansionPaths());
};
public static C withExpansionPaths(final MetaModelExpansionDslExpansionModelRead meta, final Function> m) {
return meta.withExpansionPaths(m.apply(meta.expansionModel()).expansionPaths());
}
public static C plusExpansionPaths(final MetaModelExpansionDslExpansionModelRead meta, final ExpansionPath expansionPath) {
return plusExpansionPaths(meta, Collections.singletonList(expansionPath));
}
public static C plusExpansionPaths(final MetaModelExpansionDslExpansionModelRead meta, final List> expansionPaths) {
return meta.withExpansionPaths(listOf(meta.expansionPaths(), expansionPaths));
}
public static C withExpansionPaths(final MetaModelExpansionDslExpansionModelRead meta, final ExpansionPath expansionPath) {
return meta.withExpansionPaths(Collections.singletonList(expansionPath));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy