Class JpaInventoryLocation

  • All Implemented Interfaces:
    com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware, com.broadleafcommerce.data.tracking.core.ApplicationTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking>, com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware, com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable, com.broadleafcommerce.data.tracking.core.Temporal, com.broadleafcommerce.data.tracking.core.Trackable, com.broadleafcommerce.data.tracking.core.TypedTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking>, com.broadleafcommerce.translation.domain.Translatable, Serializable

    @Entity
    @TrackableExtension(APPLICATION)
    public class JpaInventoryLocation
    extends Object
    implements Serializable, com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable, com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware, com.broadleafcommerce.data.tracking.core.ApplicationTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking>, com.broadleafcommerce.data.tracking.core.Temporal, com.broadleafcommerce.translation.domain.Translatable
    JPA representation of an InventoryLocation.
    Author:
    Kelly Tisdell (ktisdell)
    See Also:
    Serialized Form
    • Constructor Detail

      • JpaInventoryLocation

        public JpaInventoryLocation()
    • Method Detail

      • fromMe

        @NonNull
        public org.modelmapper.ModelMapper fromMe()
        Specified by:
        fromMe in interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
      • addFromMeAddressMappings

        protected void addFromMeAddressMappings​(org.modelmapper.ModelMapper mapper)
      • fromMeAddressSetter

        protected <V> org.modelmapper.spi.DestinationSetter<InventoryLocation,​V> fromMeAddressSetter​(org.modelmapper.spi.DestinationSetter<Address,​V> setterOnAddress)
      • toMe

        @NonNull
        public org.modelmapper.ModelMapper toMe()
        Specified by:
        toMe in interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
      • addToMeAddressMappings

        protected void addToMeAddressMappings​(org.modelmapper.ModelMapper mapper)
      • toMeAddressGetter

        protected org.modelmapper.spi.SourceGetter<InventoryLocation> toMeAddressGetter​(org.modelmapper.spi.SourceGetter<Address> getterOnAddress)
      • getBusinessDomainType

        public Class<?> getBusinessDomainType()
        Specified by:
        getBusinessDomainType in interface com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
      • getContextId

        public String getContextId()
        The jpa primary key.
        Specified by:
        getContextId in interface com.broadleafcommerce.data.tracking.core.Trackable
        Specified by:
        getContextId in interface com.broadleafcommerce.translation.domain.Translatable
        Returns:
        The jpa primary key
      • getName

        public String getName()
        Arbitrary name of the location. Could be a store name, or warehouse name, or other name.
      • getLocationNumber

        public String getLocationNumber()
        Arbitrary inventory location number. Could be store number, warehouse number, or some soft foreign key reference to another system.
      • isShippingLocation

        public boolean isShippingLocation()
        Indicates if this location is a shipping location. Typically (but not always), retail stores are not shipping locations. Rather, typically, warehouses are shipping locations. Some locations are both (i.e. warehouses can allow customer pickup and stores can allow shipping).
      • isPickupLocation

        public boolean isPickupLocation()
        Indicates if this location is a pickup location. Typically (but not always), warehouses are not pickup locations. Rather, typically, warehouses are shipping locations and stores are pickup locations. Some locations are both (i.e. warehouses can allow customer pickup and stores can allow shipping).
      • isStoreLocation

        public boolean isStoreLocation()
        Indicates if this location is a "Store" location, or a place where customers can go to shop. Store locations are InventoryLocations since they likely contain inventory. They may or may not also be shipping locations and/or pickup locations.
      • getTimestamp

        public Instant getTimestamp()
        Temporal state describing the time at which this item was last updated. Relates to the Temporal interface and is primarily used during consumption of messages regarding changes in state to this domain. For example, a service consuming a change notification for this domain can compare the current persisted timestamp to this timestamp to determine if it already has a newer version, in which case, it can ignore. This is primarily a measure to ensure that ordering is not required for messages related to state change.
        Specified by:
        getTimestamp in interface com.broadleafcommerce.data.tracking.core.Temporal
        Returns:
        Temporal state describing the time at which this item was last updated
      • getLatitude

        public Double getLatitude()
        Latitude, in terms of Earth's coordinates.
      • getLongitude

        public Double getLongitude()
        Longitude, in terms of Earth's coordinates.
      • getAddressLine1

        public String getAddressLine1()
        Address 1
      • getAddressLine2

        public String getAddressLine2()
        Address 2
      • getAddressLine3

        public String getAddressLine3()
        Address 3
      • getCity

        public String getCity()
        City
      • getStateProvinceRegion

        public String getStateProvinceRegion()
        Typically two or three character State, Province, or Region code (e.g. TX, NY, CA in the US; AB, ON, BC in CA)
      • getCountry

        public String getCountry()
        Country code
      • getPostalCode

        public String getPostalCode()
        The postal code, or Zip code (US). These are not necessarily unique from country to country, so care should be taken to include country when querying for postal code.
      • getTracking

        public com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking getTracking()
        Specified by:
        getTracking in interface com.broadleafcommerce.data.tracking.core.Trackable
        See Also:
        ApplicationJpaTracking
      • setContextId

        public void setContextId​(String contextId)
        The jpa primary key.
        Specified by:
        setContextId in interface com.broadleafcommerce.data.tracking.core.Trackable
        Parameters:
        LOCATION_ID - (or contextId) - The jpa primary key
      • setName

        public void setName​(String name)
        Arbitrary name of the location. Could be a store name, or warehouse name, or other name.
      • setLocationNumber

        public void setLocationNumber​(String locationNumber)
        Arbitrary inventory location number. Could be store number, warehouse number, or some soft foreign key reference to another system.
      • setShippingLocation

        public void setShippingLocation​(boolean shippingLocation)
        Indicates if this location is a shipping location. Typically (but not always), retail stores are not shipping locations. Rather, typically, warehouses are shipping locations. Some locations are both (i.e. warehouses can allow customer pickup and stores can allow shipping).
      • setPickupLocation

        public void setPickupLocation​(boolean pickupLocation)
        Indicates if this location is a pickup location. Typically (but not always), warehouses are not pickup locations. Rather, typically, warehouses are shipping locations and stores are pickup locations. Some locations are both (i.e. warehouses can allow customer pickup and stores can allow shipping).
      • setStoreLocation

        public void setStoreLocation​(boolean storeLocation)
        Indicates if this location is a "Store" location, or a place where customers can go to shop. Store locations are InventoryLocations since they likely contain inventory. They may or may not also be shipping locations and/or pickup locations.
      • setTimestamp

        public void setTimestamp​(Instant timestamp)
        Temporal state describing the time at which this item was last updated. Relates to the Temporal interface and is primarily used during consumption of messages regarding changes in state to this domain. For example, a service consuming a change notification for this domain can compare the current persisted timestamp to this timestamp to determine if it already has a newer version, in which case, it can ignore. This is primarily a measure to ensure that ordering is not required for messages related to state change.
        Specified by:
        setTimestamp in interface com.broadleafcommerce.data.tracking.core.Temporal
        Parameters:
        timestamp - Temporal state describing the time at which this item was last updated
      • setLatitude

        public void setLatitude​(Double latitude)
        Latitude, in terms of Earth's coordinates.
      • setLongitude

        public void setLongitude​(Double longitude)
        Longitude, in terms of Earth's coordinates.
      • setAddressLine1

        public void setAddressLine1​(String addressLine1)
        Address 1
      • setAddressLine2

        public void setAddressLine2​(String addressLine2)
        Address 2
      • setAddressLine3

        public void setAddressLine3​(String addressLine3)
        Address 3
      • setCity

        public void setCity​(String city)
        City
      • setStateProvinceRegion

        public void setStateProvinceRegion​(String stateProvinceRegion)
        Typically two or three character State, Province, or Region code (e.g. TX, NY, CA in the US; AB, ON, BC in CA)
      • setCountry

        public void setCountry​(String country)
        Country code
      • setPostalCode

        public void setPostalCode​(String postalCode)
        The postal code, or Zip code (US). These are not necessarily unique from country to country, so care should be taken to include country when querying for postal code.
      • setTracking

        public void setTracking​(com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking tracking)
        Specified by:
        setTracking in interface com.broadleafcommerce.data.tracking.core.TypedTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking>
        See Also:
        ApplicationJpaTracking
      • canEqual

        protected boolean canEqual​(Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object