Class HappyHourDiscount

    • Constructor Detail

      • HappyHourDiscount

        public HappyHourDiscount()
        Constructs a new empty instance.
      • HappyHourDiscount

        protected HappyHourDiscount​(boolean noInit)
        Constructs a new empty instance.
      • HappyHourDiscount

        public HappyHourDiscount​(JSONObject jsonObject)
        Construct a new instance backed by the given JSONObject, the parameter is not copied so changes to it will be reflected in this instance and vice-versa.
      • HappyHourDiscount

        public HappyHourDiscount​(HappyHourDiscount src)
        Constructs a new instance that is a deep copy of the source instance. It does not copy the bundle or changelog.
    • Method Detail

      • getId

        public String getId()
        Unique identifier
      • getName

        public String getName()
        Name of the discount
      • getAmount

        public Long getAmount()
        Discount amount in currency units(e.g. cents)
      • getPercentage

        public Long getPercentage()
        Discount amount in percent
      • getBeginTimeHours

        public Integer getBeginTimeHours()
        Discount begin hours time
      • getEndTimeHours

        public Integer getEndTimeHours()
        Discount end hours time
      • getBeginTimeMinutes

        public Integer getBeginTimeMinutes()
        Discount begin time minutes
      • getEndTimeMinutes

        public Integer getEndTimeMinutes()
        Discount end time minutes
      • getCategoryIds

        public List<String> getCategoryIds()
        list of category ids associated with this discount.
      • getItemIds

        public List<String> getItemIds()
        list of item ids associated with this discount.
      • getDaysOfWeek

        public List<String> getDaysOfWeek()
        Days of week on which this discount is applicable
      • getJSONObject

        public JSONObject getJSONObject()
        Returns the internal JSONObject backing this instance, the return value is not a copy so changes to it will be reflected in this instance and vice-versa.
        Specified by:
        getJSONObject in interface JSONifiable
      • isNotNullId

        public boolean isNotNullId()
        Checks whether the 'id' field is set and is not null
      • isNotNullName

        public boolean isNotNullName()
        Checks whether the 'name' field is set and is not null
      • isNotNullAmount

        public boolean isNotNullAmount()
        Checks whether the 'amount' field is set and is not null
      • isNotNullPercentage

        public boolean isNotNullPercentage()
        Checks whether the 'percentage' field is set and is not null
      • isNotNullBeginTimeHours

        public boolean isNotNullBeginTimeHours()
        Checks whether the 'beginTimeHours' field is set and is not null
      • isNotNullEndTimeHours

        public boolean isNotNullEndTimeHours()
        Checks whether the 'endTimeHours' field is set and is not null
      • isNotNullBeginTimeMinutes

        public boolean isNotNullBeginTimeMinutes()
        Checks whether the 'beginTimeMinutes' field is set and is not null
      • isNotNullEndTimeMinutes

        public boolean isNotNullEndTimeMinutes()
        Checks whether the 'endTimeMinutes' field is set and is not null
      • isNotNullCategoryIds

        public boolean isNotNullCategoryIds()
        Checks whether the 'categoryIds' field is set and is not null
      • isNotEmptyCategoryIds

        public boolean isNotEmptyCategoryIds()
        Checks whether the 'categoryIds' field is set and is not null and is not empty
      • isNotNullItemIds

        public boolean isNotNullItemIds()
        Checks whether the 'itemIds' field is set and is not null
      • isNotEmptyItemIds

        public boolean isNotEmptyItemIds()
        Checks whether the 'itemIds' field is set and is not null and is not empty
      • isNotNullDaysOfWeek

        public boolean isNotNullDaysOfWeek()
        Checks whether the 'daysOfWeek' field is set and is not null
      • isNotEmptyDaysOfWeek

        public boolean isNotEmptyDaysOfWeek()
        Checks whether the 'daysOfWeek' field is set and is not null and is not empty
      • hasId

        public boolean hasId()
        Checks whether the 'id' field has been set, however the value could be null
      • hasName

        public boolean hasName()
        Checks whether the 'name' field has been set, however the value could be null
      • hasAmount

        public boolean hasAmount()
        Checks whether the 'amount' field has been set, however the value could be null
      • hasPercentage

        public boolean hasPercentage()
        Checks whether the 'percentage' field has been set, however the value could be null
      • hasBeginTimeHours

        public boolean hasBeginTimeHours()
        Checks whether the 'beginTimeHours' field has been set, however the value could be null
      • hasEndTimeHours

        public boolean hasEndTimeHours()
        Checks whether the 'endTimeHours' field has been set, however the value could be null
      • hasBeginTimeMinutes

        public boolean hasBeginTimeMinutes()
        Checks whether the 'beginTimeMinutes' field has been set, however the value could be null
      • hasEndTimeMinutes

        public boolean hasEndTimeMinutes()
        Checks whether the 'endTimeMinutes' field has been set, however the value could be null
      • hasCategoryIds

        public boolean hasCategoryIds()
        Checks whether the 'categoryIds' field has been set, however the value could be null
      • hasItemIds

        public boolean hasItemIds()
        Checks whether the 'itemIds' field has been set, however the value could be null
      • hasDaysOfWeek

        public boolean hasDaysOfWeek()
        Checks whether the 'daysOfWeek' field has been set, however the value could be null
      • setPercentage

        public HappyHourDiscount setPercentage​(Long percentage)
        Sets the field 'percentage'.
      • setBeginTimeHours

        public HappyHourDiscount setBeginTimeHours​(Integer beginTimeHours)
        Sets the field 'beginTimeHours'.
      • setBeginTimeMinutes

        public HappyHourDiscount setBeginTimeMinutes​(Integer beginTimeMinutes)
        Sets the field 'beginTimeMinutes'.
      • setEndTimeMinutes

        public HappyHourDiscount setEndTimeMinutes​(Integer endTimeMinutes)
        Sets the field 'endTimeMinutes'.
      • setCategoryIds

        public HappyHourDiscount setCategoryIds​(List<String> categoryIds)
        Sets the field 'categoryIds'. Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
      • setItemIds

        public HappyHourDiscount setItemIds​(List<String> itemIds)
        Sets the field 'itemIds'. Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
      • setDaysOfWeek

        public HappyHourDiscount setDaysOfWeek​(List<String> daysOfWeek)
        Sets the field 'daysOfWeek'. Nulls in the given List are skipped. List parameter is copied, so it will not reflect any changes, but objects inside it will.
      • clearId

        public void clearId()
        Clears the 'id' field, the 'has' method for this field will now return false
      • clearName

        public void clearName()
        Clears the 'name' field, the 'has' method for this field will now return false
      • clearAmount

        public void clearAmount()
        Clears the 'amount' field, the 'has' method for this field will now return false
      • clearPercentage

        public void clearPercentage()
        Clears the 'percentage' field, the 'has' method for this field will now return false
      • clearBeginTimeHours

        public void clearBeginTimeHours()
        Clears the 'beginTimeHours' field, the 'has' method for this field will now return false
      • clearEndTimeHours

        public void clearEndTimeHours()
        Clears the 'endTimeHours' field, the 'has' method for this field will now return false
      • clearBeginTimeMinutes

        public void clearBeginTimeMinutes()
        Clears the 'beginTimeMinutes' field, the 'has' method for this field will now return false
      • clearEndTimeMinutes

        public void clearEndTimeMinutes()
        Clears the 'endTimeMinutes' field, the 'has' method for this field will now return false
      • clearCategoryIds

        public void clearCategoryIds()
        Clears the 'categoryIds' field, the 'has' method for this field will now return false
      • clearItemIds

        public void clearItemIds()
        Clears the 'itemIds' field, the 'has' method for this field will now return false
      • clearDaysOfWeek

        public void clearDaysOfWeek()
        Clears the 'daysOfWeek' field, the 'has' method for this field will now return false
      • containsChanges

        public boolean containsChanges()
        Returns true if this instance has any changes.
      • resetChangeLog

        public void resetChangeLog()
        Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
      • copyChanges

        public HappyHourDiscount copyChanges()
        Create a copy of this instance that contains only fields that were set after the constructor was called.
      • mergeChanges

        public void mergeChanges​(HappyHourDiscount src)
        Copy all the changed fields from the given source to this instance.