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

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

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

import javax.annotation.Nullable;
import java.util.List;

import static java.util.stream.Collectors.toList;

public class ExpandedModel extends ExpansionModel implements ExpansionPathContainer {

    protected ExpandedModel(@Nullable final String parentPath, @Nullable final String path) {
        super(parentPath, path);
    }

    public ExpandedModel() {
        this((String) null, null);
    }

    public ExpandedModel(final List pathExpression, final String path) {
        super(pathExpression, path);
    }

    protected static String collection(final String segmentName, final Integer index) {
        return String.format("%s[%d]", segmentName, index);
    }

    @Override
    public List> expansionPaths() {
        return buildPathExpression().stream().map(ExpansionPath::of).collect(toList());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy