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

io.sphere.sdk.expansion.ExpansionDslUtil Maven / Gradle / Ivy

There is a newer version: 1.0.0-M26
Show newest version
package io.sphere.sdk.expansion;

import java.util.Collections;
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()));
    };

    public static  C withExpansionPaths(final MetaModelExpansionDslExpansionModelRead meta, final Function> m) {
        return meta.withExpansionPaths(Collections.singletonList(m.apply(meta.expansionModel())));
    }

    public static  C plusExpansionPaths(final MetaModelExpansionDslExpansionModelRead meta, final ExpansionPath expansionPath) {
        return meta.withExpansionPaths(listOf(meta.expansionPaths(), expansionPath));
    }

    public static  C withExpansionPaths(final MetaModelExpansionDslExpansionModelRead meta, final ExpansionPath expansionPath) {
        return meta.withExpansionPaths(Collections.singletonList(expansionPath));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy