PublicationData extends TLVStructure { public String getPublicationString() { byte[] imprint = publicationHash.getImprint(); byte[] data = new byte[imprint.length + 8]; System.arraycopy(Util.toByteArray(publicationTime.getTime() / 1000), 0, data, 0, 8); System.arraycopy(imprint, 0, data, 8, imprint.length); return Base32.encodeWithDashes(Util.addCrc32(data)); } PublicationData(TLVElement rootElement);  PublicationData(String publicationString);  PublicationData(Date publicationTime, DataHash publicationHash); Date getPublicationTime(); DataHash getPublicationDataHash(); String getPublicationString(); @Override int getElementType(); byte[] getEncoded(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final int ELEMENT_TYPE; }
@Test public void testCreatePublicationDataUsingPublicationString_Ok() throws Exception { PublicationData publicationData = new PublicationData(PUBLICATION_STRING); Assert.assertEquals(publicationData.getPublicationString(), PUBLICATION_STRING); }