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;

public class ExpandedModel extends ExpansionModel implements ExpansionPath {

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

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

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

    @Override
    public String toSphereExpand() {
        return buildPathExpression();
    }

    @Override
    public final int hashCode() {
        return toSphereExpand().hashCode();
    }

    @Override
    public final boolean equals(final Object o) {
        return ExpansionPathBase.equals(this, o);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy