Class MapSerializerUtil
- java.lang.Object
-
- jetbrains.buildServer.messages.serviceMessages.MapSerializerUtil
-
public class MapSerializerUtil extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
MapSerializerUtil.EscapeInfoProvider
Deprecated.static interface
MapSerializerUtil.EscapeInfoProvider2
String escaping info provider.static class
MapSerializerUtil.UnescapeResult
-
Field Summary
Fields Modifier and Type Field Description protected static String
PARSING_ERROR_PREFIX
static MapSerializerUtil.EscapeInfoProvider
STD_ESCAPER
Deprecated.useSTD_ESCAPER2
static MapSerializerUtil.EscapeInfoProvider2
STD_ESCAPER2
-
Constructor Summary
Constructors Constructor Description MapSerializerUtil()
-
Method Summary
-
-
-
Field Detail
-
PARSING_ERROR_PREFIX
protected static final String PARSING_ERROR_PREFIX
- See Also:
- Constant Field Values
-
STD_ESCAPER
@Deprecated public static final MapSerializerUtil.EscapeInfoProvider STD_ESCAPER
Deprecated.useSTD_ESCAPER2
-
STD_ESCAPER2
public static final MapSerializerUtil.EscapeInfoProvider2 STD_ESCAPER2
-
-
Method Detail
-
stringToProperties
@Deprecated @NotNull public static Map<String,String> stringToProperties(@NotNull String string, @NotNull MapSerializerUtil.EscapeInfoProvider escaper) throws ParseException
Deprecated.performs conversion of string to property map with string name checking.- Parameters:
string
- source stringescaper
- escaping rule provider- Returns:
- the resulted property map
- Throws:
ParseException
- if parsing of the property sting failed- See Also:
stringToProperties(String, jetbrains.buildServer.messages.serviceMessages.MapSerializerUtil.EscapeInfoProvider, boolean)
-
stringToProperties
@NotNull public static Map<String,String> stringToProperties(@NotNull String string, @NotNull MapSerializerUtil.EscapeInfoProvider2 escaper) throws ParseException
performs conversion of string to property map with string name checking.- Parameters:
string
- source stringescaper
- escaping rule provider- Returns:
- the resulted property map
- Throws:
ParseException
- if parsing of the property sting failed- See Also:
stringToProperties(String, jetbrains.buildServer.messages.serviceMessages.MapSerializerUtil.EscapeInfoProvider, boolean)
-
propertiesToString
@Deprecated public static String propertiesToString(Map<String,String> props, MapSerializerUtil.EscapeInfoProvider escaper)
-
propertiesToString
@NotNull public static String propertiesToString(@NotNull Map<String,String> props, @NotNull MapSerializerUtil.EscapeInfoProvider2 escaper)
-
stringToProperties
@Deprecated @NotNull public static Map<String,String> stringToProperties(@NotNull String string, @NotNull MapSerializerUtil.EscapeInfoProvider escaper, boolean strictNameCheck) throws ParseException
Deprecated.Converts string to property map- Parameters:
string
- in a form of "name1='value' name2='value' ..."escaper
- escaping rule providerstrictNameCheck
- if true each name is checked to be a valid java identifier, otherwise it's only checked for absence of spaces- Returns:
- the resulted property map
- Throws:
ParseException
- if parsing of the property sting failed
-
stringToProperties
@NotNull public static Map<String,String> stringToProperties(@NotNull String string, @NotNull MapSerializerUtil.EscapeInfoProvider2 escaper, boolean strictNameCheck) throws ParseException
Converts string to property map- Parameters:
string
- in a form of "name1='value' name2='value' ..."escaper
- escaping rule providerstrictNameCheck
- if true each name is checked to be a valid java identifier, otherwise it's only checked for absence of spaces- Returns:
- the resulted property map
- Throws:
ParseException
- if parsing of the property sting failed
-
indexOf
@Deprecated public static int indexOf(String currentString, char findWhat, MapSerializerUtil.EscapeInfoProvider escaper)
-
indexOf
public static int indexOf(@NotNull String currentString, char findWhat, @NotNull MapSerializerUtil.EscapeInfoProvider2 escaper)
-
isValidJavaIdentifier
public static boolean isValidJavaIdentifier(@NotNull String name)
-
escapeStr
@Deprecated public static String escapeStr(String str, MapSerializerUtil.EscapeInfoProvider p)
Deprecated.Escapes characters specified by provider with '\' and specified character.- Parameters:
str
- initial stringp
- escape info provider.- Returns:
- escaped string.
-
escapeStr
@Nullable @Contract("null,_->null; !null,_->!null") public static String escapeStr(@Nullable String str, @NotNull MapSerializerUtil.EscapeInfoProvider2 p)
Escapes characters specified by provider with '\' and specified character.- Parameters:
str
- initial stringp
- escape info provider.- Returns:
- escaped string.
-
unescapeStr
@Nullable @Deprecated public static String unescapeStr(@Nullable String str, @NotNull MapSerializerUtil.EscapeInfoProvider p)
Deprecated.Unescapes characters specified by provider with '\' and specified character.- Parameters:
str
- initial stringp
- escape info provider.- Returns:
- unescaped string.
-
unescapeStr
@Nullable public static String unescapeStr(@Nullable String str, @NotNull MapSerializerUtil.EscapeInfoProvider2 p)
Unescapes characters specified by provider with '\' and specified character.- Parameters:
str
- initial stringp
- escape info provider.- Returns:
- unescaped string.
-
-