@Test public void testCopy() { Map<Symbol, Object> properties = new HashMap<>(); properties.put(Symbol.valueOf("x-opt"), "value"); Begin begin = new Begin(); begin.setRemoteChannel(UnsignedShort.valueOf((short) 2)); begin.setNextOutgoingId(UnsignedInteger.valueOf(10)); begin.setIncomingWindow(UnsignedInteger.valueOf(11)); begin.setOutgoingWindow(UnsignedInteger.valueOf(12)); begin.setHandleMax(UnsignedInteger.valueOf(13)); begin.setDesiredCapabilities(new Symbol[0]); begin.setOfferedCapabilities(new Symbol[] { Symbol.valueOf("anonymous-relay") }); begin.setProperties(properties); final Begin copyOf = begin.copy(); assertEquals(begin.getRemoteChannel(), copyOf.getRemoteChannel()); assertEquals(begin.getNextOutgoingId(), copyOf.getNextOutgoingId()); assertEquals(begin.getIncomingWindow(), copyOf.getIncomingWindow()); assertEquals(begin.getOutgoingWindow(), copyOf.getOutgoingWindow()); assertEquals(begin.getHandleMax(), copyOf.getHandleMax()); assertArrayEquals(begin.getDesiredCapabilities(), copyOf.getDesiredCapabilities()); assertArrayEquals(begin.getOfferedCapabilities(), copyOf.getOfferedCapabilities()); assertEquals(begin.getProperties(), copyOf.getProperties()); }
@Override public Begin copy() { return new Begin(this); }
Begin implements FrameBody { @Override public Begin copy() { return new Begin(this); } }
Begin implements FrameBody { @Override public Begin copy() { return new Begin(this); } Begin(); @SuppressWarnings("unchecked")  Begin(Begin other); }
Begin implements FrameBody { @Override public Begin copy() { return new Begin(this); } Begin(); @SuppressWarnings("unchecked")  Begin(Begin other); UnsignedShort getRemoteChannel(); void setRemoteChannel(UnsignedShort remoteChannel); UnsignedInteger getNextOutgoingId(); void setNextOutgoingId(UnsignedInteger nextOutgoingId); UnsignedInteger getIncomingWindow(); void setIncomingWindow(UnsignedInteger incomingWindow); UnsignedInteger getOutgoingWindow(); void setOutgoingWindow(UnsignedInteger outgoingWindow); UnsignedInteger getHandleMax(); void setHandleMax(UnsignedInteger handleMax); Symbol[] getOfferedCapabilities(); void setOfferedCapabilities(Symbol... offeredCapabilities); Symbol[] getDesiredCapabilities(); void setDesiredCapabilities(Symbol... desiredCapabilities); Map getProperties(); void setProperties(Map properties); @Override void invoke(FrameBodyHandler<E> handler, Binary payload, E context); @Override String toString(); @Override Begin copy(); }
Begin implements FrameBody { @Override public Begin copy() { return new Begin(this); } Begin(); @SuppressWarnings("unchecked")  Begin(Begin other); UnsignedShort getRemoteChannel(); void setRemoteChannel(UnsignedShort remoteChannel); UnsignedInteger getNextOutgoingId(); void setNextOutgoingId(UnsignedInteger nextOutgoingId); UnsignedInteger getIncomingWindow(); void setIncomingWindow(UnsignedInteger incomingWindow); UnsignedInteger getOutgoingWindow(); void setOutgoingWindow(UnsignedInteger outgoingWindow); UnsignedInteger getHandleMax(); void setHandleMax(UnsignedInteger handleMax); Symbol[] getOfferedCapabilities(); void setOfferedCapabilities(Symbol... offeredCapabilities); Symbol[] getDesiredCapabilities(); void setDesiredCapabilities(Symbol... desiredCapabilities); Map getProperties(); void setProperties(Map properties); @Override void invoke(FrameBodyHandler<E> handler, Binary payload, E context); @Override String toString(); @Override Begin copy();  }