com.exadel.aem.toolkit.plugin.utils.StringUtil Maven / Gradle / Ivy
/*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.exadel.aem.toolkit.plugin.utils;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.function.Function;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import com.google.common.collect.ImmutableMap;
import com.exadel.aem.toolkit.core.CoreConstants;
/**
* Contains utility methods for parsing and formatting string values
*/
public class StringUtil {
private static final String TYPE_TOKEN_TEMPLATE = "{%s}";
private static final String TYPED_VALUE_TEMPLATE = "{%s}%s";
private static final String ARRAY_TEMPLATE = "[%s]";
private static final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX";
private static final String ESCAPE_STRING = "\\";
private static final String SPLITTING_PATTERN = "\\s*,\\s*";
private static final Pattern ATTRIBUTE_LIST_PATTERN = Pattern.compile("^\\[.+]$");
private static final Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy