@Test public void newInstance () { val node = "popa"; val id = 500; val serial = 10; val creation = 42; val bytes = Bytes.resizableArray() .write1B(PID.getCode()) .writeNB(new ErlangAtom(node).toBytes()) .write4B(id & 0x7FFF) .write4B(serial & 0x1FFF) .write1B(creation & 0x3) .arrayCopy(); ErlangPid pid = ErlangTerm.newInstance(wrappedBuffer(bytes)); assertThat(pid).isNotNull(); SoftAssertions.assertSoftly(softly -> { softly.assertThat(pid.getDescriptor().getNodeName()) .isEqualTo(node); softly.assertThat(pid.getId()) .isEqualTo(id & 0x7FFF); softly.assertThat(pid.getSerial()) .isEqualTo(serial & 0x1FFF); softly.assertThat(pid.getCreation()) .isEqualTo(creation & 0x3); }); }
public final NodeDescriptor getDescriptor () { if (descriptor == null) { descriptor = NodeDescriptor.from(node.asText()); } return descriptor; }
ErlangPid extends ErlangTerm { public final NodeDescriptor getDescriptor () { if (descriptor == null) { descriptor = NodeDescriptor.from(node.asText()); } return descriptor; } }
ErlangPid extends ErlangTerm { public final NodeDescriptor getDescriptor () { if (descriptor == null) { descriptor = NodeDescriptor.from(node.asText()); } return descriptor; } ErlangPid(TermType type, @NonNull ByteBuf buffer); @Builder private  ErlangPid(TermType type, @NonNull String node, int id, int serial, int creation); }
ErlangPid extends ErlangTerm { public final NodeDescriptor getDescriptor () { if (descriptor == null) { descriptor = NodeDescriptor.from(node.asText()); } return descriptor; } ErlangPid(TermType type, @NonNull ByteBuf buffer); @Builder private  ErlangPid(TermType type, @NonNull String node, int id, int serial, int creation); @Override String asText(String defaultValue); @Override ErlangPid asPid(); @Override String toString(); final NodeDescriptor getDescriptor(); }
ErlangPid extends ErlangTerm { public final NodeDescriptor getDescriptor () { if (descriptor == null) { descriptor = NodeDescriptor.from(node.asText()); } return descriptor; } ErlangPid(TermType type, @NonNull ByteBuf buffer); @Builder private  ErlangPid(TermType type, @NonNull String node, int id, int serial, int creation); @Override String asText(String defaultValue); @Override ErlangPid asPid(); @Override String toString(); final NodeDescriptor getDescriptor();  }