Skip to content
This repository has been archived by the owner on Feb 6, 2019. It is now read-only.

Commit

Permalink
Update javadoc and visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekn committed Nov 17, 2015
1 parent f588b89 commit f97c033
Show file tree
Hide file tree
Showing 22 changed files with 39 additions and 107 deletions.
2 changes: 0 additions & 2 deletions src/main/java/org/stellar/base/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ public Account(Keypair keypair, long sequenceNumber) {

/**
* Returns keypair associated with this Account
* @return
*/
public Keypair getKeypair() {
return mKeypair;
}

/**
* Returns current sequence number ot this Account.
* @return
*/
public long getSequenceNumber() {
return mSequenceNumber;
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/stellar/base/AccountMergeOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ private AccountMergeOperation(Keypair destination) {

/**
* The account that receives the remaining XLM balance of the source account.
* @return
*/
public Keypair getDestination() {
return mDestination;
Expand Down Expand Up @@ -67,7 +66,6 @@ public Builder setSourceAccount(Keypair sourceAccount) {

/**
* Builds an operation
* @return
*/
public AccountMergeOperation build() {
AccountMergeOperation operation = new AccountMergeOperation(mDestination);
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/org/stellar/base/AllowTrustOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,20 @@ private AllowTrustOperation(Keypair trustor, String assetCode, boolean authorize

/**
* The account of the recipient of the trustline.
* @return
*/
public Keypair getTrustor() {
return mTrustor;
}

/**
* The asset of the trustline the source account is authorizing. For example, if a gateway wants to allow another account to hold its USD credit, the type is USD.
* @return
*/
public String getAssetCode() {
return mAssetCode;
}

/**
* Flag indicating whether the trustline is authorized.
* @return
*/
public boolean getAuthorize() {
return mAuthorize;
Expand Down Expand Up @@ -122,7 +119,6 @@ public Builder setSourceAccount(Keypair sourceAccount) {

/**
* Builds an operation
* @return
*/
public AllowTrustOperation build() {
AllowTrustOperation operation = new AllowTrustOperation(mTrustor, mAssetCode, mAuthorize);
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/org/stellar/base/Asset.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

/**
* Base Asset class.
* @see <a href="https://www.stellar.org/developers/learn/concepts/assets.html" target="_blank">Assets</a>
*/
public abstract class Asset {
Asset() {
//
}

/**
* Creates one of AssetTypeCreditAlphaNum4 or AssetTypeCreditAlphaNum12 object based on a <code>code</code> length
* @param code Asset code
* @param issuer Asset issuer
* @return
*/
public static Asset createNonNativeAsset(String code, Keypair issuer) {
if (code.length() >= 1 && code.length() <= 4) {
Expand All @@ -23,7 +27,6 @@ public static Asset createNonNativeAsset(String code, Keypair issuer) {
/**
* Generates Asset object from a given XDR object
* @param xdr XDR object
* @return
*/
public static Asset fromXdr(org.stellar.base.xdr.Asset xdr) {
switch (xdr.getDiscriminant()) {
Expand All @@ -48,7 +51,6 @@ public static Asset fromXdr(org.stellar.base.xdr.Asset xdr) {

/**
* Generates XDR object from a given Asset object
* @return
*/
public abstract org.stellar.base.xdr.Asset toXdr();
}
3 changes: 1 addition & 2 deletions src/main/java/org/stellar/base/AssetTypeCreditAlphaNum.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

/**
* Base class for AssetTypeCreditAlphaNum4 and AssetTypeCreditAlphaNum12 subclasses.
* @see <a href="https://www.stellar.org/developers/learn/concepts/assets.html" target="_blank">Assets</a>
*/
abstract class AssetTypeCreditAlphaNum extends Asset {
protected final String mCode;
Expand All @@ -14,15 +15,13 @@ public AssetTypeCreditAlphaNum(String code, Keypair issuer) {

/**
* Returns asset code
* @return
*/
public String getCode() {
return mCode;
}

/**
* Returns asset issuer
* @return
*/
public Keypair getIssuer() {
return mIssuer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

/**
* Represents all assets with codes 5-12 characters long.
* @see <a href="https://www.stellar.org/developers/learn/concepts/assets.html" target="_blank">Assets</a>
*/
public class AssetTypeCreditAlphaNum12 extends AssetTypeCreditAlphaNum {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

/**
* Represents all assets with codes 1-4 characters long.
* @see <a href="https://www.stellar.org/developers/learn/concepts/assets.html" target="_blank">Assets</a>
*/
public class AssetTypeCreditAlphaNum4 extends AssetTypeCreditAlphaNum {

Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/stellar/base/AssetTypeNative.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

/**
* Represents Stellar native asset - <a href="https://www.stellar.org/developers/learn/concepts/assets.html" target="_blank">lumens (XLM)</a>
* @see <a href="https://www.stellar.org/developers/learn/concepts/assets.html" target="_blank">Assets</a>
*/
public class AssetTypeNative extends Asset {

Expand Down
3 changes: 0 additions & 3 deletions src/main/java/org/stellar/base/ChangeTrustOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@ private ChangeTrustOperation(Asset asset, long limit) {

/**
* The asset of the trustline. For example, if a gateway extends a trustline of up to 200 USD to a user, the line is USD.
* @return
*/
public Asset getAsset() {
return mAsset;
}

/**
* The limit of the trustline. For example, if a gateway extends a trustline of up to 200 USD to a user, the limit is 200.
* @return
*/
public long getLimit() {
return mLimit;
Expand Down Expand Up @@ -85,7 +83,6 @@ public Builder setSourceAccount(Keypair sourceAccount) {

/**
* Builds an operation
* @return
*/
public ChangeTrustOperation build() {
ChangeTrustOperation operation = new ChangeTrustOperation(mAsset, mLimit);
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/org/stellar/base/CreateAccountOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ private CreateAccountOperation(Keypair destination, long startingBalance) {

/**
* Amount of XLM to send to the newly created account.
* @return
*/
public long getStartingBalance() {
return mStartingBalance;
}

/**
* Account that is created and funded.
* @return
* Account that is created and funded
*/
public Keypair getDestination() {
return mDestination;
Expand Down Expand Up @@ -83,7 +81,7 @@ public Builder(Keypair destination, long startingBalance) {
/**
* Sets the source account for this operation.
* @param account The operation's source account.
* @return
* @return Builder object so you can chain methods.
*/
public Builder setSourceAccount(Keypair account) {
mSourceAccount = account;
Expand All @@ -92,7 +90,6 @@ public Builder setSourceAccount(Keypair account) {

/**
* Builds an operation
* @return
*/
public CreateAccountOperation build() {
CreateAccountOperation operation = new CreateAccountOperation(mDestination, mStartingBalance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,27 @@ private CreatePassiveOfferOperation(Asset selling, Asset buying, long amount, St

/**
* The asset being sold in this operation
* @return
*/
public Asset getSelling() {
return mSelling;
}

/**
* The asset being bought in this operation
* @return
*/
public Asset getBuying() {
return mBuying;
}

/**
* Amount of selling being sold.
* @return
*/
public long getAmount() {
return mAmount;
}

/**
* Price of 1 unit of selling in terms of buying.
* @return
*/
public String getPrice() {
return mPrice;
Expand Down Expand Up @@ -116,7 +112,7 @@ public Builder(Asset selling, Asset buying, long amount, String price) {
/**
* Sets the source account for this operation.
* @param sourceAccount The operation's source account.
* @return
* @return Builder object so you can chain methods.
*/
public Builder setSourceAccount(Keypair sourceAccount) {
mSourceAccount = sourceAccount;
Expand All @@ -125,7 +121,6 @@ public Builder setSourceAccount(Keypair sourceAccount) {

/**
* Builds an operation
* @return
*/
public CreatePassiveOfferOperation build() {
CreatePassiveOfferOperation operation = new CreatePassiveOfferOperation(mSelling, mBuying, mAmount, mPrice);
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/org/stellar/base/Keypair.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,13 @@ public static Keypair random() {

/**
* Returns the human readable address encoded in strkey.
* @return
*/
public String getAddress() {
return StrKey.encodeStellarAddress(mPublicKey.getAbyte());
}

/**
* Returns the human readable secret seed encoded in strkey.
* @return
*/
public String getSecretSeed() {
return StrKey.encodeStellarSecretSeed(mPrivateKey.getSeed());
Expand Down Expand Up @@ -178,7 +176,6 @@ public byte[] sign(byte[] data) {
/**
* Sign the provided data with the keypair's private key and returns {@link DecoratedSignature}.
* @param data
* @return
*/
public DecoratedSignature signDecorated(byte[] data) {
byte[] signatureBytes = this.sign(data);
Expand Down
8 changes: 1 addition & 7 deletions src/main/java/org/stellar/base/ManagerOfferOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,39 +30,34 @@ private ManagerOfferOperation(Asset selling, Asset buying, long amount, String p

/**
* The asset being sold in this operation
* @return
*/
public Asset getSelling() {
return mSelling;
}

/**
* The asset being bought in this operation
* @return
*/
public Asset getBuying() {
return mBuying;
}

/**
* Amount of selling being sold.
* @return
*/
public long getAmount() {
return mAmount;
}

/**
* Price of 1 unit of selling in terms of buying.
* @return
*/
public String getPrice() {
return mPrice;
}

/**
* The ID of the offer.
* @return
*/
public long getOfferId() {
return mOfferId;
Expand Down Expand Up @@ -143,7 +138,7 @@ public Builder setOfferId(long offerId) {
/**
* Sets the source account for this operation.
* @param account The operation's source account.
* @return
* @return Builder object so you can chain methods.
*/
public Builder setSourceAccount(Keypair account) {
mSourceAccount = account;
Expand All @@ -152,7 +147,6 @@ public Builder setSourceAccount(Keypair account) {

/**
* Builds an operation
* @return
*/
public ManagerOfferOperation build() {
ManagerOfferOperation operation = new ManagerOfferOperation(mSelling, mBuying, mAmount, mPrice, mOfferId);
Expand Down
Loading

0 comments on commit f97c033

Please sign in to comment.