
com.araguacaima.commons.utils.builder.QueryParamSplitter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons-utils Show documentation
Show all versions of commons-utils Show documentation
Common utilities is a set of java utilities for managing typical actions when working with enums,
files, exceptions, zip/jar files, classes (via Reflection), maps, numbers and so on.
Most of the utilities extend functionalities offered by amazing libraries such as:
* commons-beanutils (apache)
* commons-lang3 (apache)
* commons-io (apache)
* commons-math3 (apache)
* commons-collections4 (apache)
* jreversepro (akkumar)
package com.araguacaima.commons.utils.builder;
import com.araguacaima.commons.utils.Constants;
public class QueryParamSplitter implements SpecialParamSplitter {
private final Constants.SpecialQueryParams specialQueryParam = Constants.SpecialQueryParams.QUERY_PARAM;
private String completeParam;
private String rightSideParam;
private String leftSideParam;
private QueryParamSplitter() {
}
public QueryParamSplitter(String queryParamToStore) {
try {
completeParam = queryParamToStore;
String[] tokens = queryParamToStore.split("=");
leftSideParam = tokens[0];
rightSideParam = tokens[1];
} catch (Throwable ignored) {
throw new IllegalArgumentException("The provided queryParam '" + queryParamToStore + "' is not of a simple query kind");
}
}
@Override
public Constants.SpecialQueryParams getSpecialQueryParam() {
return this.specialQueryParam;
}
@Override
public String getCompleteParam() {
return this.completeParam;
}
@Override
public String getLeftSideParam() {
return this.leftSideParam;
}
@Override
public String getRightSideParam() {
return this.rightSideParam;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy