@Test public void testWriteRaw() { Metadata raw = new Metadata(KEY.asciiName(), LANCE_BYTES); Fish lance = raw.get(KEY); assertEquals(lance, new Fish(LANCE)); assertSame(lance, raw.get(KEY)); }
public <T> T get(Key<T> key) { List<MetadataEntry> values = store.get(key.name()); if (values == null) { return null; } MetadataEntry metadataEntry = values.get(values.size() - 1); return metadataEntry.getParsed(key); }
Metadata { public <T> T get(Key<T> key) { List<MetadataEntry> values = store.get(key.name()); if (values == null) { return null; } MetadataEntry metadataEntry = values.get(values.size() - 1); return metadataEntry.getParsed(key); } }
Metadata { public <T> T get(Key<T> key) { List<MetadataEntry> values = store.get(key.name()); if (values == null) { return null; } MetadataEntry metadataEntry = values.get(values.size() - 1); return metadataEntry.getParsed(key); } @Internal  Metadata(byte[]... binaryValues);  Metadata(); }
Metadata { public <T> T get(Key<T> key) { List<MetadataEntry> values = store.get(key.name()); if (values == null) { return null; } MetadataEntry metadataEntry = values.get(values.size() - 1); return metadataEntry.getParsed(key); } @Internal  Metadata(byte[]... binaryValues);  Metadata(); @Internal int headerCount(); boolean containsKey(Key<?> key); T get(Key<T> key); Iterable<T> getAll(final Key<T> key); Set<String> keys(); void put(Key<T> key, T value); boolean remove(Key<T> key, T value); Iterable<T> removeAll(final Key<T> key); @Internal byte[][] serialize(); void merge(Metadata other); void merge(Metadata other, Set<Key<?>> keys); @Override String toString(); }
Metadata { public <T> T get(Key<T> key) { List<MetadataEntry> values = store.get(key.name()); if (values == null) { return null; } MetadataEntry metadataEntry = values.get(values.size() - 1); return metadataEntry.getParsed(key); } @Internal  Metadata(byte[]... binaryValues);  Metadata(); @Internal int headerCount(); boolean containsKey(Key<?> key); T get(Key<T> key); Iterable<T> getAll(final Key<T> key); Set<String> keys(); void put(Key<T> key, T value); boolean remove(Key<T> key, T value); Iterable<T> removeAll(final Key<T> key); @Internal byte[][] serialize(); void merge(Metadata other); void merge(Metadata other, Set<Key<?>> keys); @Override String toString(); static final String BINARY_HEADER_SUFFIX; static final BinaryMarshaller<byte[]> BINARY_BYTE_MARSHALLER; static final AsciiMarshaller<String> ASCII_STRING_MARSHALLER; }