-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "unknown transaction""
This reverts commit 18f9dab.
- Loading branch information
Showing
49 changed files
with
1,692 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnknownTransaction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package org.xrpl.xrpl4j.model.transactions; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import org.immutables.value.Value; | ||
import org.immutables.value.Value.Immutable; | ||
import org.xrpl.xrpl4j.model.flags.TransactionFlags; | ||
|
||
@Immutable | ||
@JsonSerialize(as = ImmutableUnknownTransaction.class) | ||
@JsonDeserialize(as = ImmutableUnknownTransaction.class) | ||
public interface UnknownTransaction extends Transaction { | ||
|
||
/** | ||
* Construct a {@code UnknownTransaction} builder. | ||
* | ||
* @return An {@link ImmutableUnknownTransaction.Builder}. | ||
*/ | ||
static ImmutableUnknownTransaction.Builder builder() { | ||
return ImmutableUnknownTransaction.builder(); | ||
} | ||
|
||
/** | ||
* This has to be a {@link String} because {@link Transaction#transactionType()} is a {@link TransactionType}, | ||
* which only has an UNKNOWN variant. Because this method is also annotated with {@link JsonProperty} of | ||
* "TransactionType", this essentially overrides the "TransactionType" field in JSON, but {@link #transactionType()} | ||
* will always be {@link TransactionType#UNKNOWN} and this field will contain the actual "TransactionType" field. | ||
* | ||
* @return A {@link String} containing the transaction type from JSON. | ||
*/ | ||
@JsonProperty("TransactionType") | ||
String unknownTransactionType(); | ||
|
||
@Override | ||
@JsonIgnore | ||
default TransactionType transactionType() { | ||
return Transaction.super.transactionType(); | ||
} | ||
|
||
@JsonProperty("Flags") | ||
@Value.Default | ||
default TransactionFlags flags() { | ||
return TransactionFlags.EMPTY; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.