public static void checkMetadataEntry(MetadataEntry metadataEntry) { // Check required fields assertNotNull( metadataEntry.getKey(), String.format(NOT_NULL_OBJECT_FMT, "Key", "MetadataEntry")); assertNotNull( metadataEntry.getValue(), String.format(NOT_NULL_OBJECT_FMT, "Value", "MetadataEntry")); // Check parent type checkResourceType(metadataEntry); }
public static void checkMetadataFor(String client, Metadata metadata) { for (MetadataEntry entry : metadata.getMetadataEntries()) { // Check required fields assertNotNull( entry.getKey(), String.format(OBJ_FIELD_ATTRB_REQ, client, "MetadataEntry", entry.getKey(), "key")); assertNotNull( entry.getValue(), String.format(OBJ_FIELD_ATTRB_REQ, client, "MetadataEntry", entry.getValue(), "value")); // Check parent type checkResourceType(entry); } // Check parent type checkResourceType(metadata); }