Class Expiry


  • public class Expiry
    extends Object
    Expiry
    • Constructor Detail

      • Expiry

        public Expiry()
    • Method Detail

      • getMonth

        public String getMonth()
        The month in which the card will expire.
        Returns:
        month
      • setMonth

        public void setMonth​(String month)
      • getYear

        public String getYear()
        The year in which the card will expire.
        Returns:
        year
      • setYear

        public void setYear​(String year)
      • hashCode

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

        public static void validateJsonObject​(com.google.gson.JsonObject jsonObj)
                                       throws IOException
        Throws:
        IOException
      • validateJsonObject

        public static void validateJsonObject​(com.google.gson.JsonObject jsonObj,
                                              boolean strictValidation)
                                       throws IOException
        Validates the JSON Object and throws an exception if issues found
        Parameters:
        jsonObj - JSON Object
        strictValidation - reject (new) fields missing from the specifications
        Throws:
        IOException - if the JSON Object is invalid with respect to Expiry
      • fromJson

        public static Expiry fromJson​(String jsonString)
                               throws IOException
        Create an instance of Expiry given an JSON string
        Parameters:
        jsonString - JSON string
        Returns:
        An instance of Expiry
        Throws:
        IOException - if the JSON string is invalid with respect to Expiry
      • toJson

        public String toJson()
        Convert an instance of Expiry to an JSON string
        Returns:
        JSON string