@Test public void testNameNeedsEscaping() { assertFalse("null", nameNeedsEscaping(null)); assertFalse("empty", nameNeedsEscaping("")); assertFalse("normal", nameNeedsEscaping("abc")); assertTrue("digit start", nameNeedsEscaping("1abc")); assertTrue("quote start", nameNeedsEscaping("\"abc")); assertTrue("slash start", nameNeedsEscaping("/abc")); assertTrue("special char", nameNeedsEscaping("a bc")); }
public static boolean nameNeedsEscaping(@Nullable String name) { return name != null && !name.isEmpty() && (name.startsWith(ESCAPE_CHAR) || Character.isDigit(name.charAt(0)) || name.startsWith("/") || nameContainsSpecialChar(name)); }
Names { public static boolean nameNeedsEscaping(@Nullable String name) { return name != null && !name.isEmpty() && (name.startsWith(ESCAPE_CHAR) || Character.isDigit(name.charAt(0)) || name.startsWith("/") || nameContainsSpecialChar(name)); } }
Names { public static boolean nameNeedsEscaping(@Nullable String name) { return name != null && !name.isEmpty() && (name.startsWith(ESCAPE_CHAR) || Character.isDigit(name.charAt(0)) || name.startsWith("/") || nameContainsSpecialChar(name)); } private  Names(); }
Names { public static boolean nameNeedsEscaping(@Nullable String name) { return name != null && !name.isEmpty() && (name.startsWith(ESCAPE_CHAR) || Character.isDigit(name.charAt(0)) || name.startsWith("/") || nameContainsSpecialChar(name)); } private  Names(); static void checkName(String name, String objectDescription, Type type); static String generatedBgpCommonExportPolicyName(String vrf); static String generatedBgpDefaultRouteExportPolicyName(boolean ipv4); static String generatedBgpPeerExportPolicyName(String vrf, String peer); static String generatedBgpPeerImportPolicyName(String vrf, String peer); static String generatedBgpPeerEvpnExportPolicyName(String vrf, String peer); static String generatedReferenceBook(String hostname, String source); static String zoneToZoneFilter(String fromZone, String toZone); static boolean nameNeedsEscaping(@Nullable String name); static String escapeNameIfNeeded(@Nullable String name); }
Names { public static boolean nameNeedsEscaping(@Nullable String name) { return name != null && !name.isEmpty() && (name.startsWith(ESCAPE_CHAR) || Character.isDigit(name.charAt(0)) || name.startsWith("/") || nameContainsSpecialChar(name)); } private  Names(); static void checkName(String name, String objectDescription, Type type); static String generatedBgpCommonExportPolicyName(String vrf); static String generatedBgpDefaultRouteExportPolicyName(boolean ipv4); static String generatedBgpPeerExportPolicyName(String vrf, String peer); static String generatedBgpPeerImportPolicyName(String vrf, String peer); static String generatedBgpPeerEvpnExportPolicyName(String vrf, String peer); static String generatedReferenceBook(String hostname, String source); static String zoneToZoneFilter(String fromZone, String toZone); static boolean nameNeedsEscaping(@Nullable String name); static String escapeNameIfNeeded(@Nullable String name); static final String ESCAPE_CHAR; static final String SPECIAL_CHARS; }