@Test public void testFromJson() throws IOException { String serialized = "{\"dataset\":{\"Transfer-Encoding\":[\"gzip\",\"aes_rotating\"]},\"file\":{\"part.task_hello-world_1488584636479_1.json.gzip.aes_rotating\":{\"exists\":\"true\"}}}"; GlobalMetadata md = GlobalMetadata.fromJson(serialized); List<String> transferEncoding = md.getTransferEncoding(); Assert.assertEquals(transferEncoding, ImmutableList.of("gzip", "aes_rotating")); Assert.assertEquals(md.getFileMetadata("part.task_hello-world_1488584636479_1.json.gzip.aes_rotating", "exists"), "true"); }
public static GlobalMetadata fromJson(String json) throws IOException { return objectMapper.readValue(json, GlobalMetadata.class); }
GlobalMetadata { public static GlobalMetadata fromJson(String json) throws IOException { return objectMapper.readValue(json, GlobalMetadata.class); } }
GlobalMetadata { public static GlobalMetadata fromJson(String json) throws IOException { return objectMapper.readValue(json, GlobalMetadata.class); } GlobalMetadata(); }
GlobalMetadata { public static GlobalMetadata fromJson(String json) throws IOException { return objectMapper.readValue(json, GlobalMetadata.class); } GlobalMetadata(); void markImmutable(); boolean isImmutable(); static GlobalMetadata fromJson(String json); void addAll(GlobalMetadata other); void mergeWithDefaults(GlobalMetadata defaults); byte[] toJsonUtf8(); String toJson(); String getDatasetUrn(); void setDatasetUrn(String urn); void setContentType(String contentType); String getContentType(); void setInnerContentType(String innerContentType); String getInnerContentType(); void setNumOutputFiles(int numFiles); void setNumRecords(long numRecords); Object getDatasetMetadata(String key); void setDatasetMetadata(String key, Object val); @SuppressWarnings("unchecked") List<String> getTransferEncoding(); synchronized void addTransferEncoding(String encoding); long getNumRecords(); int getNumFiles(); Object getFileMetadata(String file, String key); void setFileMetadata(String file, String key, Object val); @Override boolean equals(Object o); @Override int hashCode(); String getId(); boolean isEmpty(); }
GlobalMetadata { public static GlobalMetadata fromJson(String json) throws IOException { return objectMapper.readValue(json, GlobalMetadata.class); } GlobalMetadata(); void markImmutable(); boolean isImmutable(); static GlobalMetadata fromJson(String json); void addAll(GlobalMetadata other); void mergeWithDefaults(GlobalMetadata defaults); byte[] toJsonUtf8(); String toJson(); String getDatasetUrn(); void setDatasetUrn(String urn); void setContentType(String contentType); String getContentType(); void setInnerContentType(String innerContentType); String getInnerContentType(); void setNumOutputFiles(int numFiles); void setNumRecords(long numRecords); Object getDatasetMetadata(String key); void setDatasetMetadata(String key, Object val); @SuppressWarnings("unchecked") List<String> getTransferEncoding(); synchronized void addTransferEncoding(String encoding); long getNumRecords(); int getNumFiles(); Object getFileMetadata(String file, String key); void setFileMetadata(String file, String key, Object val); @Override boolean equals(Object o); @Override int hashCode(); String getId(); boolean isEmpty(); final static String DATASET_URN_KEY; final static String TRANSFER_ENCODING_KEY; final static String CONTENT_TYPE_KEY; final static String INNER_CONTENT_TYPE_KEY; final static String NUM_RECORDS_KEY; final static String NUM_FILES_KEY; }