io.sphere.sdk.search.SimpleBaseExpression Maven / Gradle / Ivy
package io.sphere.sdk.search;
import io.sphere.sdk.models.Base;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
abstract class SimpleBaseExpression extends Base {
protected SimpleBaseExpression() {
}
abstract protected String expression();
public String attributePath() {
final Pattern pattern = Pattern.compile("^([^:\\s]*)");
final Matcher matcher = pattern.matcher(expression());
return matcher.find() ? matcher.group(1) : expression();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy