Class Address

    • Field Detail

      • street

        @Expose
        protected java.util.List<java.lang.String> street
        At most three lines of addresses parsed from XML elements.

        This field is used to marshal to/unmarshal from XML elements. When persisting to/from SQL, the next three separate fields are used. Those lines are only used for persistence purpose and should not be directly used in Java.

        We need to keep the list and the three fields in sync in all the following scenarios when an entity containing a Address is created:

        The syncing is especially important because when merging a detached entity into a session, JPA provides no guarantee that transient fields will be preserved. In fact, Hibernate chooses to discard them when returning a newly merged entity. This means that it is not enough to provide callbacks to populate the fields based on the list before persistence, as merging does not invoke the callbacks, and we would lose the address fields if only the list is set. Instead, the fields must be populated when the list is.

        Schema validation will enforce the 3-line limit.

      • city

        @Expose
        protected java.lang.String city
      • state

        @Expose
        protected java.lang.String state
      • zip

        @Expose
        protected java.lang.String zip
      • countryCode

        @Expose
        protected java.lang.String countryCode
    • Constructor Detail

      • Address

        public Address()
    • Method Detail

      • getStreet

        public com.google.common.collect.ImmutableList<java.lang.String> getStreet()
      • getCity

        public java.lang.String getCity()
      • getState

        public java.lang.String getState()
      • getZip

        public java.lang.String getZip()
      • getCountryCode

        public java.lang.String getCountryCode()
      • toJsonMap

        public java.util.Map<java.lang.String,​java.lang.Object> toJsonMap()
        Description copied from interface: Jsonifiable
        Returns a JSON representation of this object.

        The returned value must not return sensitive fields, so that it may be safe to return to the client via an API response.

        Specified by:
        toJsonMap in interface Jsonifiable