Class Ticket


  • public class Ticket
    extends Object
    Ticket
    • Constructor Summary

      Constructors 
      Constructor Description
      Ticket()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(Object o)
      Return true if this Ticket object is equal to o.
      static Ticket fromJson​(String jsonString)
      Create an instance of Ticket given an JSON string
      String getIssueAddress()
      The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters
      LocalDate getIssueDate()
      The date that the ticket was issued to the passenger. * minLength: 10 characters * maxLength: 10 characters * Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd
      String getNumber()
      The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not start with a space or be all spaces. * Must not be all zeros.
      int hashCode()  
      Ticket issueAddress​(String issueAddress)
      The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters
      Ticket issueDate​(LocalDate issueDate)
      The date that the ticket was issued to the passenger. * minLength: 10 characters * maxLength: 10 characters * Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd
      Ticket number​(String number)
      The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not start with a space or be all spaces. * Must not be all zeros.
      void setIssueAddress​(String issueAddress)
      The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters
      void setIssueDate​(LocalDate issueDate)
      The date that the ticket was issued to the passenger. * minLength: 10 characters * maxLength: 10 characters * Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd
      void setNumber​(String number)
      The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not start with a space or be all spaces. * Must not be all zeros.
      String toJson()
      Convert an instance of Ticket to an JSON string
      String toString()  
    • Constructor Detail

      • Ticket

        public Ticket()
    • Method Detail

      • issueAddress

        public Ticket issueAddress​(String issueAddress)
        The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters
        Parameters:
        issueAddress - The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters
        Returns:
        the current Ticket instance, allowing for method chaining
      • getIssueAddress

        public String getIssueAddress()
        The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters
        Returns:
        issueAddress The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters
      • setIssueAddress

        public void setIssueAddress​(String issueAddress)
        The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters
        Parameters:
        issueAddress - The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters
      • issueDate

        public Ticket issueDate​(LocalDate issueDate)
        The date that the ticket was issued to the passenger. * minLength: 10 characters * maxLength: 10 characters * Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd
        Parameters:
        issueDate - The date that the ticket was issued to the passenger. * minLength: 10 characters * maxLength: 10 characters * Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd
        Returns:
        the current Ticket instance, allowing for method chaining
      • getIssueDate

        public LocalDate getIssueDate()
        The date that the ticket was issued to the passenger. * minLength: 10 characters * maxLength: 10 characters * Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd
        Returns:
        issueDate The date that the ticket was issued to the passenger. * minLength: 10 characters * maxLength: 10 characters * Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd
      • setIssueDate

        public void setIssueDate​(LocalDate issueDate)
        The date that the ticket was issued to the passenger. * minLength: 10 characters * maxLength: 10 characters * Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd
        Parameters:
        issueDate - The date that the ticket was issued to the passenger. * minLength: 10 characters * maxLength: 10 characters * Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd
      • number

        public Ticket number​(String number)
        The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not start with a space or be all spaces. * Must not be all zeros.
        Parameters:
        number - The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not start with a space or be all spaces. * Must not be all zeros.
        Returns:
        the current Ticket instance, allowing for method chaining
      • getNumber

        public String getNumber()
        The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not start with a space or be all spaces. * Must not be all zeros.
        Returns:
        number The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not start with a space or be all spaces. * Must not be all zeros.
      • setNumber

        public void setNumber​(String number)
        The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not start with a space or be all spaces. * Must not be all zeros.
        Parameters:
        number - The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not start with a space or be all spaces. * Must not be all zeros.
      • equals

        public boolean equals​(Object o)
        Return true if this Ticket object is equal to o.
        Overrides:
        equals in class Object
      • hashCode

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

        public static Ticket fromJson​(String jsonString)
                               throws com.fasterxml.jackson.core.JsonProcessingException
        Create an instance of Ticket given an JSON string
        Parameters:
        jsonString - JSON string
        Returns:
        An instance of Ticket
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - if the JSON string is invalid with respect to Ticket
      • toJson

        public String toJson()
                      throws com.fasterxml.jackson.core.JsonProcessingException
        Convert an instance of Ticket to an JSON string
        Returns:
        JSON string
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException