Class ClaimPredicate

java.lang.Object
org.stellar.sdk.xdr.ClaimPredicate
All Implemented Interfaces:
XdrElement

public class ClaimPredicate extends Object implements XdrElement
ClaimPredicate's original definition in the XDR file is:
 union ClaimPredicate switch (ClaimPredicateType type)
 {
 case CLAIM_PREDICATE_UNCONDITIONAL:
     void;
 case CLAIM_PREDICATE_AND:
     ClaimPredicate andPredicates<2>;
 case CLAIM_PREDICATE_OR:
     ClaimPredicate orPredicates<2>;
 case CLAIM_PREDICATE_NOT:
     ClaimPredicate* notPredicate;
 case CLAIM_PREDICATE_BEFORE_ABSOLUTE_TIME:
     int64 absBefore; // Predicate will be true if closeTime < absBefore
 case CLAIM_PREDICATE_BEFORE_RELATIVE_TIME:
     int64 relBefore; // Seconds since closeTime of the ledger in which the
                      // ClaimableBalanceEntry was created
 };
 
  • Constructor Details

    • ClaimPredicate

      public ClaimPredicate()
    • ClaimPredicate

      public ClaimPredicate(ClaimPredicateType discriminant, ClaimPredicate[] andPredicates, ClaimPredicate[] orPredicates, ClaimPredicate notPredicate, Int64 absBefore, Int64 relBefore)
      Creates a new ClaimPredicate instance.
      Parameters:
      discriminant - the discriminant field value
      andPredicates - the andPredicates field value
      orPredicates - the orPredicates field value
      notPredicate - the notPredicate field value
      absBefore - the absBefore field value
      relBefore - the relBefore field value
  • Method Details

    • encode

      public void encode(XdrDataOutputStream stream) throws IOException
      Description copied from interface: XdrElement
      Encodes this value to XDR and writes it to the provided stream.
      Specified by:
      encode in interface XdrElement
      Parameters:
      stream - the destination XDR output stream
      Throws:
      IOException - if an I/O error occurs while writing the value
    • decode

      public static ClaimPredicate decode(XdrDataInputStream stream, int maxDepth) throws IOException
      Throws:
      IOException
    • decode

      public static ClaimPredicate decode(XdrDataInputStream stream) throws IOException
      Throws:
      IOException
    • fromXdrBase64

      public static ClaimPredicate fromXdrBase64(String xdr) throws IOException
      Throws:
      IOException
    • fromXdrByteArray

      public static ClaimPredicate fromXdrByteArray(byte[] xdr) throws IOException
      Throws:
      IOException
    • toJson

      public String toJson()
      Description copied from interface: XdrElement
      Serializes this value to JSON.
      Specified by:
      toJson in interface XdrElement
      Returns:
      the JSON representation of this value
    • fromJson

      public static ClaimPredicate fromJson(String json)
    • builder

      public static ClaimPredicate.ClaimPredicateBuilder builder()
    • toBuilder

    • getDiscriminant

      public ClaimPredicateType getDiscriminant()
      Value of the discriminant field.
      Returns:
      the discriminant field value
    • getAndPredicates

      public ClaimPredicate[] getAndPredicates()
      Value of the andPredicates field.
      Returns:
      the andPredicates field value
    • getOrPredicates

      public ClaimPredicate[] getOrPredicates()
      Value of the orPredicates field.
      Returns:
      the orPredicates field value
    • getNotPredicate

      public ClaimPredicate getNotPredicate()
      Value of the notPredicate field.
      Returns:
      the notPredicate field value
    • getAbsBefore

      public Int64 getAbsBefore()
      Value of the absBefore field.
      Returns:
      the absBefore field value
    • getRelBefore

      public Int64 getRelBefore()
      Value of the relBefore field.
      Returns:
      the relBefore field value
    • setDiscriminant

      public void setDiscriminant(ClaimPredicateType discriminant)
      Value of the discriminant field.
      Parameters:
      discriminant - the discriminant field value
    • setAndPredicates

      public void setAndPredicates(ClaimPredicate[] andPredicates)
      Value of the andPredicates field.
      Parameters:
      andPredicates - the andPredicates field value
    • setOrPredicates

      public void setOrPredicates(ClaimPredicate[] orPredicates)
      Value of the orPredicates field.
      Parameters:
      orPredicates - the orPredicates field value
    • setNotPredicate

      public void setNotPredicate(ClaimPredicate notPredicate)
      Value of the notPredicate field.
      Parameters:
      notPredicate - the notPredicate field value
    • setAbsBefore

      public void setAbsBefore(Int64 absBefore)
      Value of the absBefore field.
      Parameters:
      absBefore - the absBefore field value
    • setRelBefore

      public void setRelBefore(Int64 relBefore)
      Value of the relBefore field.
      Parameters:
      relBefore - the relBefore field value
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object