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