@Test public void testUppercaseUuidNormalization() { final String lowercaseUuid = "90210716-99f8-0a4f-8119-9bfc16cd68a3"; final String lowercaseNormalizedUuid = ParsePayload.normalizeUuid(lowercaseUuid); assertEquals(lowercaseNormalizedUuid, lowercaseUuid); final String uppercaseUuid = "90210716-99F8-0A4F-8119-9BFC16CD68A3"; final String uppercaseNormalizedUuid = ParsePayload.normalizeUuid(uppercaseUuid); assertEquals(uppercaseNormalizedUuid, lowercaseUuid); }
@VisibleForTesting static String normalizeUuid(String v) { if (v == null) { return null; } v = v.replaceAll("[{}]", ""); try { UUID.fromString(v); return v.toLowerCase(); } catch (IllegalArgumentException ignore) { return null; } }
ParsePayload extends
    PTransform<PCollection<PubsubMessage>, Result<PCollection<PubsubMessage>, PubsubMessage>> { @VisibleForTesting static String normalizeUuid(String v) { if (v == null) { return null; } v = v.replaceAll("[{}]", ""); try { UUID.fromString(v); return v.toLowerCase(); } catch (IllegalArgumentException ignore) { return null; } } }
ParsePayload extends
    PTransform<PCollection<PubsubMessage>, Result<PCollection<PubsubMessage>, PubsubMessage>> { @VisibleForTesting static String normalizeUuid(String v) { if (v == null) { return null; } v = v.replaceAll("[{}]", ""); try { UUID.fromString(v); return v.toLowerCase(); } catch (IllegalArgumentException ignore) { return null; } } private  ParsePayload(ValueProvider<String> schemasLocation); }
ParsePayload extends
    PTransform<PCollection<PubsubMessage>, Result<PCollection<PubsubMessage>, PubsubMessage>> { @VisibleForTesting static String normalizeUuid(String v) { if (v == null) { return null; } v = v.replaceAll("[{}]", ""); try { UUID.fromString(v); return v.toLowerCase(); } catch (IllegalArgumentException ignore) { return null; } } private  ParsePayload(ValueProvider<String> schemasLocation); static ParsePayload of(ValueProvider<String> schemasLocation); @Override Result<PCollection<PubsubMessage>, PubsubMessage> expand(
      PCollection<PubsubMessage> messages); static String getVersionFromTelemetryPayload(JsonNode json); static void addClientIdFromPayload(Map<String, String> attributes, ObjectNode json); }
ParsePayload extends
    PTransform<PCollection<PubsubMessage>, Result<PCollection<PubsubMessage>, PubsubMessage>> { @VisibleForTesting static String normalizeUuid(String v) { if (v == null) { return null; } v = v.replaceAll("[{}]", ""); try { UUID.fromString(v); return v.toLowerCase(); } catch (IllegalArgumentException ignore) { return null; } } private  ParsePayload(ValueProvider<String> schemasLocation); static ParsePayload of(ValueProvider<String> schemasLocation); @Override Result<PCollection<PubsubMessage>, PubsubMessage> expand(
      PCollection<PubsubMessage> messages); static String getVersionFromTelemetryPayload(JsonNode json); static void addClientIdFromPayload(Map<String, String> attributes, ObjectNode json);  }