@Test public void copy() throws Exception { LookUpKey k1 = new LookUpKey(); k1.add(new IntOption(100)); LookUpKey k2 = k1.copy(); k2.add(new IntOption(200)); LookUpKey k3 = new LookUpKey(); k3.add(new IntOption(100)); k3.add(new IntOption(200)); assertThat(k1.equals(k2), is(false)); assertThat(k2.equals(k3), is(true)); assertThat(k2.hashCode(), is(k3.hashCode())); }
public LookUpKey copy() throws IOException { LookUpKey result = new LookUpKey(0); byte[] contents = Arrays.copyOfRange(buffer.getData(), buffer.getReadPosition(), buffer.getReadLimit()); result.buffer.reset(contents, 0, contents.length); return result; }
LookUpKey { public LookUpKey copy() throws IOException { LookUpKey result = new LookUpKey(0); byte[] contents = Arrays.copyOfRange(buffer.getData(), buffer.getReadPosition(), buffer.getReadLimit()); result.buffer.reset(contents, 0, contents.length); return result; } }
LookUpKey { public LookUpKey copy() throws IOException { LookUpKey result = new LookUpKey(0); byte[] contents = Arrays.copyOfRange(buffer.getData(), buffer.getReadPosition(), buffer.getReadLimit()); result.buffer.reset(contents, 0, contents.length); return result; } LookUpKey();  LookUpKey(int bufferSize); }
LookUpKey { public LookUpKey copy() throws IOException { LookUpKey result = new LookUpKey(0); byte[] contents = Arrays.copyOfRange(buffer.getData(), buffer.getReadPosition(), buffer.getReadLimit()); result.buffer.reset(contents, 0, contents.length); return result; } LookUpKey();  LookUpKey(int bufferSize); void reset(); void add(Writable writable); LookUpKey copy(); LookUpKey.View getDirectView(); LookUpKey.View getFrozenView(); @Override int hashCode(); @Override boolean equals(Object obj); }
LookUpKey { public LookUpKey copy() throws IOException { LookUpKey result = new LookUpKey(0); byte[] contents = Arrays.copyOfRange(buffer.getData(), buffer.getReadPosition(), buffer.getReadLimit()); result.buffer.reset(contents, 0, contents.length); return result; } LookUpKey();  LookUpKey(int bufferSize); void reset(); void add(Writable writable); LookUpKey copy(); LookUpKey.View getDirectView(); LookUpKey.View getFrozenView(); @Override int hashCode(); @Override boolean equals(Object obj);  }