@Test void parseMetadata () { List<GcpSSHKeyMetadata> actualKeys = GcpSSHKeyMetadata.parseMetadata(rawKeys); assertEquals(keys, actualKeys); }
public static List<GcpSSHKeyMetadata> parseMetadata (String originalMetadata) { String[] split = originalMetadata.split("\n"); return Arrays.stream(split) .filter(Objects::nonNull) .filter(not(String::isBlank)) .map(String::strip) .map(GcpSSHKeyMetadata::parseIndividualMetadata) .collect(Collectors.toList()); }
GcpSSHKeyMetadata { public static List<GcpSSHKeyMetadata> parseMetadata (String originalMetadata) { String[] split = originalMetadata.split("\n"); return Arrays.stream(split) .filter(Objects::nonNull) .filter(not(String::isBlank)) .map(String::strip) .map(GcpSSHKeyMetadata::parseIndividualMetadata) .collect(Collectors.toList()); } }
GcpSSHKeyMetadata { public static List<GcpSSHKeyMetadata> parseMetadata (String originalMetadata) { String[] split = originalMetadata.split("\n"); return Arrays.stream(split) .filter(Objects::nonNull) .filter(not(String::isBlank)) .map(String::strip) .map(GcpSSHKeyMetadata::parseIndividualMetadata) .collect(Collectors.toList()); } GcpSSHKeyMetadata(String username, String publicKey, String identifier); }
GcpSSHKeyMetadata { public static List<GcpSSHKeyMetadata> parseMetadata (String originalMetadata) { String[] split = originalMetadata.split("\n"); return Arrays.stream(split) .filter(Objects::nonNull) .filter(not(String::isBlank)) .map(String::strip) .map(GcpSSHKeyMetadata::parseIndividualMetadata) .collect(Collectors.toList()); } GcpSSHKeyMetadata(String username, String publicKey, String identifier); static List<GcpSSHKeyMetadata> parseMetadata(String originalMetadata); static String metadataFormat(Collection<GcpSSHKeyMetadata> metadataCollection); String getUsername(); String getPublicKey(); String getIdentifier(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); }
GcpSSHKeyMetadata { public static List<GcpSSHKeyMetadata> parseMetadata (String originalMetadata) { String[] split = originalMetadata.split("\n"); return Arrays.stream(split) .filter(Objects::nonNull) .filter(not(String::isBlank)) .map(String::strip) .map(GcpSSHKeyMetadata::parseIndividualMetadata) .collect(Collectors.toList()); } GcpSSHKeyMetadata(String username, String publicKey, String identifier); static List<GcpSSHKeyMetadata> parseMetadata(String originalMetadata); static String metadataFormat(Collection<GcpSSHKeyMetadata> metadataCollection); String getUsername(); String getPublicKey(); String getIdentifier(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString();  }