-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
1,487 additions
and
54 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
324 changes: 324 additions & 0 deletions
324
src/main/java/org/stellar/sdk/xdr/ContractCodeCostInputs.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,324 @@ | ||
// Automatically generated by xdrgen | ||
// DO NOT EDIT or your changes may be overwritten | ||
|
||
package org.stellar.sdk.xdr; | ||
|
||
import static org.stellar.sdk.xdr.Constants.*; | ||
|
||
import java.io.ByteArrayInputStream; | ||
import java.io.ByteArrayOutputStream; | ||
import java.io.IOException; | ||
import java.util.Objects; | ||
import org.stellar.sdk.Base64Factory; | ||
|
||
// === xdr source ============================================================ | ||
|
||
// struct ContractCodeCostInputs { | ||
// ExtensionPoint ext; | ||
// uint32 nInstructions; | ||
// uint32 nFunctions; | ||
// uint32 nGlobals; | ||
// uint32 nTableEntries; | ||
// uint32 nTypes; | ||
// uint32 nDataSegments; | ||
// uint32 nElemSegments; | ||
// uint32 nImports; | ||
// uint32 nExports; | ||
// uint32 nDataSegmentBytes; | ||
// }; | ||
|
||
// =========================================================================== | ||
public class ContractCodeCostInputs implements XdrElement { | ||
public ContractCodeCostInputs() {} | ||
|
||
private ExtensionPoint ext; | ||
|
||
public ExtensionPoint getExt() { | ||
return this.ext; | ||
} | ||
|
||
public void setExt(ExtensionPoint value) { | ||
this.ext = value; | ||
} | ||
|
||
private Uint32 nInstructions; | ||
|
||
public Uint32 getNInstructions() { | ||
return this.nInstructions; | ||
} | ||
|
||
public void setNInstructions(Uint32 value) { | ||
this.nInstructions = value; | ||
} | ||
|
||
private Uint32 nFunctions; | ||
|
||
public Uint32 getNFunctions() { | ||
return this.nFunctions; | ||
} | ||
|
||
public void setNFunctions(Uint32 value) { | ||
this.nFunctions = value; | ||
} | ||
|
||
private Uint32 nGlobals; | ||
|
||
public Uint32 getNGlobals() { | ||
return this.nGlobals; | ||
} | ||
|
||
public void setNGlobals(Uint32 value) { | ||
this.nGlobals = value; | ||
} | ||
|
||
private Uint32 nTableEntries; | ||
|
||
public Uint32 getNTableEntries() { | ||
return this.nTableEntries; | ||
} | ||
|
||
public void setNTableEntries(Uint32 value) { | ||
this.nTableEntries = value; | ||
} | ||
|
||
private Uint32 nTypes; | ||
|
||
public Uint32 getNTypes() { | ||
return this.nTypes; | ||
} | ||
|
||
public void setNTypes(Uint32 value) { | ||
this.nTypes = value; | ||
} | ||
|
||
private Uint32 nDataSegments; | ||
|
||
public Uint32 getNDataSegments() { | ||
return this.nDataSegments; | ||
} | ||
|
||
public void setNDataSegments(Uint32 value) { | ||
this.nDataSegments = value; | ||
} | ||
|
||
private Uint32 nElemSegments; | ||
|
||
public Uint32 getNElemSegments() { | ||
return this.nElemSegments; | ||
} | ||
|
||
public void setNElemSegments(Uint32 value) { | ||
this.nElemSegments = value; | ||
} | ||
|
||
private Uint32 nImports; | ||
|
||
public Uint32 getNImports() { | ||
return this.nImports; | ||
} | ||
|
||
public void setNImports(Uint32 value) { | ||
this.nImports = value; | ||
} | ||
|
||
private Uint32 nExports; | ||
|
||
public Uint32 getNExports() { | ||
return this.nExports; | ||
} | ||
|
||
public void setNExports(Uint32 value) { | ||
this.nExports = value; | ||
} | ||
|
||
private Uint32 nDataSegmentBytes; | ||
|
||
public Uint32 getNDataSegmentBytes() { | ||
return this.nDataSegmentBytes; | ||
} | ||
|
||
public void setNDataSegmentBytes(Uint32 value) { | ||
this.nDataSegmentBytes = value; | ||
} | ||
|
||
public static void encode( | ||
XdrDataOutputStream stream, ContractCodeCostInputs encodedContractCodeCostInputs) | ||
throws IOException { | ||
ExtensionPoint.encode(stream, encodedContractCodeCostInputs.ext); | ||
Uint32.encode(stream, encodedContractCodeCostInputs.nInstructions); | ||
Uint32.encode(stream, encodedContractCodeCostInputs.nFunctions); | ||
Uint32.encode(stream, encodedContractCodeCostInputs.nGlobals); | ||
Uint32.encode(stream, encodedContractCodeCostInputs.nTableEntries); | ||
Uint32.encode(stream, encodedContractCodeCostInputs.nTypes); | ||
Uint32.encode(stream, encodedContractCodeCostInputs.nDataSegments); | ||
Uint32.encode(stream, encodedContractCodeCostInputs.nElemSegments); | ||
Uint32.encode(stream, encodedContractCodeCostInputs.nImports); | ||
Uint32.encode(stream, encodedContractCodeCostInputs.nExports); | ||
Uint32.encode(stream, encodedContractCodeCostInputs.nDataSegmentBytes); | ||
} | ||
|
||
public void encode(XdrDataOutputStream stream) throws IOException { | ||
encode(stream, this); | ||
} | ||
|
||
public static ContractCodeCostInputs decode(XdrDataInputStream stream) throws IOException { | ||
ContractCodeCostInputs decodedContractCodeCostInputs = new ContractCodeCostInputs(); | ||
decodedContractCodeCostInputs.ext = ExtensionPoint.decode(stream); | ||
decodedContractCodeCostInputs.nInstructions = Uint32.decode(stream); | ||
decodedContractCodeCostInputs.nFunctions = Uint32.decode(stream); | ||
decodedContractCodeCostInputs.nGlobals = Uint32.decode(stream); | ||
decodedContractCodeCostInputs.nTableEntries = Uint32.decode(stream); | ||
decodedContractCodeCostInputs.nTypes = Uint32.decode(stream); | ||
decodedContractCodeCostInputs.nDataSegments = Uint32.decode(stream); | ||
decodedContractCodeCostInputs.nElemSegments = Uint32.decode(stream); | ||
decodedContractCodeCostInputs.nImports = Uint32.decode(stream); | ||
decodedContractCodeCostInputs.nExports = Uint32.decode(stream); | ||
decodedContractCodeCostInputs.nDataSegmentBytes = Uint32.decode(stream); | ||
return decodedContractCodeCostInputs; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash( | ||
this.ext, | ||
this.nInstructions, | ||
this.nFunctions, | ||
this.nGlobals, | ||
this.nTableEntries, | ||
this.nTypes, | ||
this.nDataSegments, | ||
this.nElemSegments, | ||
this.nImports, | ||
this.nExports, | ||
this.nDataSegmentBytes); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object object) { | ||
if (!(object instanceof ContractCodeCostInputs)) { | ||
return false; | ||
} | ||
|
||
ContractCodeCostInputs other = (ContractCodeCostInputs) object; | ||
return Objects.equals(this.ext, other.ext) | ||
&& Objects.equals(this.nInstructions, other.nInstructions) | ||
&& Objects.equals(this.nFunctions, other.nFunctions) | ||
&& Objects.equals(this.nGlobals, other.nGlobals) | ||
&& Objects.equals(this.nTableEntries, other.nTableEntries) | ||
&& Objects.equals(this.nTypes, other.nTypes) | ||
&& Objects.equals(this.nDataSegments, other.nDataSegments) | ||
&& Objects.equals(this.nElemSegments, other.nElemSegments) | ||
&& Objects.equals(this.nImports, other.nImports) | ||
&& Objects.equals(this.nExports, other.nExports) | ||
&& Objects.equals(this.nDataSegmentBytes, other.nDataSegmentBytes); | ||
} | ||
|
||
@Override | ||
public String toXdrBase64() throws IOException { | ||
return Base64Factory.getInstance().encodeToString(toXdrByteArray()); | ||
} | ||
|
||
@Override | ||
public byte[] toXdrByteArray() throws IOException { | ||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | ||
XdrDataOutputStream xdrDataOutputStream = new XdrDataOutputStream(byteArrayOutputStream); | ||
encode(xdrDataOutputStream); | ||
return byteArrayOutputStream.toByteArray(); | ||
} | ||
|
||
public static ContractCodeCostInputs fromXdrBase64(String xdr) throws IOException { | ||
byte[] bytes = Base64Factory.getInstance().decode(xdr); | ||
return fromXdrByteArray(bytes); | ||
} | ||
|
||
public static ContractCodeCostInputs fromXdrByteArray(byte[] xdr) throws IOException { | ||
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(xdr); | ||
XdrDataInputStream xdrDataInputStream = new XdrDataInputStream(byteArrayInputStream); | ||
return decode(xdrDataInputStream); | ||
} | ||
|
||
public static final class Builder { | ||
private ExtensionPoint ext; | ||
private Uint32 nInstructions; | ||
private Uint32 nFunctions; | ||
private Uint32 nGlobals; | ||
private Uint32 nTableEntries; | ||
private Uint32 nTypes; | ||
private Uint32 nDataSegments; | ||
private Uint32 nElemSegments; | ||
private Uint32 nImports; | ||
private Uint32 nExports; | ||
private Uint32 nDataSegmentBytes; | ||
|
||
public Builder ext(ExtensionPoint ext) { | ||
this.ext = ext; | ||
return this; | ||
} | ||
|
||
public Builder nInstructions(Uint32 nInstructions) { | ||
this.nInstructions = nInstructions; | ||
return this; | ||
} | ||
|
||
public Builder nFunctions(Uint32 nFunctions) { | ||
this.nFunctions = nFunctions; | ||
return this; | ||
} | ||
|
||
public Builder nGlobals(Uint32 nGlobals) { | ||
this.nGlobals = nGlobals; | ||
return this; | ||
} | ||
|
||
public Builder nTableEntries(Uint32 nTableEntries) { | ||
this.nTableEntries = nTableEntries; | ||
return this; | ||
} | ||
|
||
public Builder nTypes(Uint32 nTypes) { | ||
this.nTypes = nTypes; | ||
return this; | ||
} | ||
|
||
public Builder nDataSegments(Uint32 nDataSegments) { | ||
this.nDataSegments = nDataSegments; | ||
return this; | ||
} | ||
|
||
public Builder nElemSegments(Uint32 nElemSegments) { | ||
this.nElemSegments = nElemSegments; | ||
return this; | ||
} | ||
|
||
public Builder nImports(Uint32 nImports) { | ||
this.nImports = nImports; | ||
return this; | ||
} | ||
|
||
public Builder nExports(Uint32 nExports) { | ||
this.nExports = nExports; | ||
return this; | ||
} | ||
|
||
public Builder nDataSegmentBytes(Uint32 nDataSegmentBytes) { | ||
this.nDataSegmentBytes = nDataSegmentBytes; | ||
return this; | ||
} | ||
|
||
public ContractCodeCostInputs build() { | ||
ContractCodeCostInputs val = new ContractCodeCostInputs(); | ||
val.setExt(this.ext); | ||
val.setNInstructions(this.nInstructions); | ||
val.setNFunctions(this.nFunctions); | ||
val.setNGlobals(this.nGlobals); | ||
val.setNTableEntries(this.nTableEntries); | ||
val.setNTypes(this.nTypes); | ||
val.setNDataSegments(this.nDataSegments); | ||
val.setNElemSegments(this.nElemSegments); | ||
val.setNImports(this.nImports); | ||
val.setNExports(this.nExports); | ||
val.setNDataSegmentBytes(this.nDataSegmentBytes); | ||
return val; | ||
} | ||
} | ||
} |
Oops, something went wrong.