Updated on 2026-08-14

This commit is contained in:
Tangem 2019-01-13 15:11:29 +03:00
parent 07bc724ecd
commit 75f19d41f4
278 changed files with 19571 additions and 206 deletions

View file

@ -0,0 +1,40 @@
package org.stellar.sdk;
import org.stellar.sdk.xdr.MemoType;
import org.stellar.sdk.xdr.Uint64;
/**
* Represents MEMO_ID.
*/
public class MemoId extends Memo {
private long id;
public MemoId(long id) {
if (Long.compareUnsigned(id, 0) < 0) {
throw new IllegalArgumentException("id must be a positive number");
}
this.id = id;
}
public long getId() {
return id;
}
@Override
org.stellar.sdk.xdr.Memo toXdr() {
org.stellar.sdk.xdr.Memo memo = new org.stellar.sdk.xdr.Memo();
memo.setDiscriminant(MemoType.MEMO_ID);
Uint64 idXdr = new Uint64();
idXdr.setUint64(id);
memo.setId(idXdr);
return memo;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MemoId memoId = (MemoId) o;
return id == memoId.id;
}
}