20 package net.sf.gridarta.preferences;
22 import java.util.regex.Matcher;
23 import java.util.regex.Pattern;
24 import org.jetbrains.annotations.NotNull;
39 private static final Pattern @NotNull []
PATTERNS_ENCODE = { Pattern.compile(
"\\\\"), Pattern.compile(
"\r"), Pattern.compile(
"\n"), };
45 private static final String @NotNull []
REPLACEMENTS_ENCODE = { Matcher.quoteReplacement(
"\\\\"), Matcher.quoteReplacement(
"\\r"), Matcher.quoteReplacement(
"\\n"), };
52 private static final Pattern @NotNull []
PATTERNS_DECODE = { Pattern.compile(
"\\\\n"), Pattern.compile(
"\\\\r"), Pattern.compile(
"\\\\\\\\"), };
58 private static final String @NotNull []
REPLACEMENTS_DECODE = { Matcher.quoteReplacement(
"\n"), Matcher.quoteReplacement(
"\r"), Matcher.quoteReplacement(
"\\"), };
73 public static String
encode(@NotNull
final String str) {
89 public static String
decode(@NotNull
final String str) {