Package org.cyclos.entities.marketplace
Class BasicAd
- java.lang.Object
-
- org.cyclos.entities.SimpleEntity
-
- org.cyclos.entities.NetworkedEntity
-
- org.cyclos.entities.BaseEntity
-
- org.cyclos.entities.NamedEntity
-
- org.cyclos.entities.marketplace.BasicAd
-
- All Implemented Interfaces:
Cloneable,Comparable<NamedEntity>,HasCurrency,HasNetwork,ProcessableForProxying,EntityWithCustomValues<AdCustomField,AdCustomFieldPossibleValueCategory,AdCustomFieldPossibleValue,AdCustomFieldValue>,ImageOwner<BasicAd,AdImage>,IEntity,INamedEntity
- Direct Known Subclasses:
Advertisement,AdWebShop
@Entity public abstract class BasicAd extends NamedEntity implements HasCurrency, ImageOwner<BasicAd,AdImage>, EntityWithCustomValues<AdCustomField,AdCustomFieldPossibleValueCategory,AdCustomFieldPossibleValue,AdCustomFieldValue>
Base class for advertisement
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.cyclos.entities.SimpleEntity
SimpleEntity.EntityLoadNotifier
-
-
Field Summary
Fields Modifier and Type Field Description protected BigDecimalstockQuantityprotected AdWebShopStockTypestockType
-
Constructor Summary
Constructors Constructor Description BasicAd()
-
Method Summary
-
Methods inherited from class org.cyclos.entities.NamedEntity
compareTo, getName, getNames, setName, toShortString, toString
-
Methods inherited from class org.cyclos.entities.BaseEntity
getDataTranslationType, getVersion
-
Methods inherited from class org.cyclos.entities.NetworkedEntity
isGlobal
-
Methods inherited from class org.cyclos.entities.SimpleEntity
equals, getId, hashCode, id, ids, isPersistent, isTransient, register, setId, uniqueIds, uniqueIds
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.cyclos.entities.banking.HasCurrency
round, withCurrency
-
Methods inherited from interface org.cyclos.entities.ProcessableForProxying
getProxyClass
-
-
-
-
Field Detail
-
stockQuantity
protected BigDecimal stockQuantity
-
stockType
protected AdWebShopStockType stockType
-
-
Method Detail
-
getActualStatus
public static AdStatus getActualStatus(DatePeriod publicationPeriod, boolean removedFromOwner, Date deletedDate, AdStatus persistedStatus)
The persisted status might not be real based on the ad conditions like the publication period. Returns the ad status for the given conditions
-
getAddresses
public Set<UserAddress> getAddresses()
-
getAdHistory
public Set<AdHistoryLog> getAdHistory()
-
getAdType
public abstract AdType getAdType()
-
getAuthorizationNotes
public String getAuthorizationNotes()
-
getCategories
public Set<AdCategory> getCategories()
-
getCreationDate
public Date getCreationDate()
-
getCurrency
public Currency getCurrency()
- Specified by:
getCurrencyin interfaceHasCurrency
-
getCurrentPrice
public BigDecimal getCurrentPrice()
-
getCustomFieldClass
public Class<AdCustomField> getCustomFieldClass()
Description copied from interface:EntityWithCustomValuesReturns custom field the class on this entity- Specified by:
getCustomFieldClassin interfaceEntityWithCustomValues<AdCustomField,AdCustomFieldPossibleValueCategory,AdCustomFieldPossibleValue,AdCustomFieldValue>
-
getCustomFieldValueClass
public Class<AdCustomFieldValue> getCustomFieldValueClass()
Description copied from interface:EntityWithCustomValuesReturns the class for storing custom field values- Specified by:
getCustomFieldValueClassin interfaceEntityWithCustomValues<AdCustomField,AdCustomFieldPossibleValueCategory,AdCustomFieldPossibleValue,AdCustomFieldValue>
-
getCustomValues
public Set<AdCustomFieldValue> getCustomValues()
Description copied from interface:EntityWithCustomValuesReturns all custom field values- Specified by:
getCustomValuesin interfaceEntityWithCustomValues<AdCustomField,AdCustomFieldPossibleValueCategory,AdCustomFieldPossibleValue,AdCustomFieldValue>
-
getDeletedDate
public Date getDeletedDate()
-
getDescription
public String getDescription()
-
getDiscriminator
public AdType getDiscriminator()
-
getImage
public AdImage getImage()
Description copied from interface:ImageOwnerEither the single image or a de-normalized reference to the first image- Specified by:
getImagein interfaceImageOwner<BasicAd,AdImage>
-
getImageCount
public int getImageCount()
-
getImages
public List<AdImage> getImages()
Description copied from interface:ImageOwnerEither all images or a collection with the single image- Specified by:
getImagesin interfaceImageOwner<BasicAd,AdImage>
-
getLastModified
public Date getLastModified()
-
getNetwork
public Network getNetwork()
Description copied from interface:HasNetworkReturns the network this entity belongs to- Specified by:
getNetworkin interfaceHasNetwork
-
getNotifiedAdInterests
public Set<NotifiedAdInterest> getNotifiedAdInterests()
-
getNumberOfImages
public Integer getNumberOfImages()
-
getOwner
public User getOwner()
-
getPersistedStatus
public AdStatus getPersistedStatus()
-
getPrice
public CurrencyAmount getPrice()
-
getPromotionalPeriod
public DatePeriod getPromotionalPeriod()
-
getPromotionalPrice
public BigDecimal getPromotionalPrice()
-
getPublicationPeriod
public DatePeriod getPublicationPeriod()
-
getQuestions
public Set<AdQuestion> getQuestions()
-
getSingleCategory
public AdCategory getSingleCategory()
-
getStatus
public AdStatus getStatus()
-
getType
public AdType getType()
-
isAdInterestNotified
public boolean isAdInterestNotified()
-
isDoProcess
public boolean isDoProcess()
-
isExpirationNotified
public boolean isExpirationNotified()
-
isHidden
public boolean isHidden()
-
isInStock
public abstract boolean isInStock()
-
isPromotionalPeriodActive
public boolean isPromotionalPeriodActive()
-
isRemovedFromOwner
public boolean isRemovedFromOwner()
-
setAddresses
public void setAddresses(Set<UserAddress> addresses)
-
setAdHistory
public void setAdHistory(Set<AdHistoryLog> adHistory)
-
setAuthorizationNotes
public void setAuthorizationNotes(String authorizationNotes)
-
setCategories
public void setCategories(Set<AdCategory> categories)
-
setCreationDate
public void setCreationDate(Date creationDate)
-
setCustomValues
public void setCustomValues(Set<AdCustomFieldValue> customValues)
-
setDeletedDate
public void setDeletedDate(Date deletedDate)
-
setDescription
public void setDescription(String description)
-
setDoProcess
public void setDoProcess(boolean doProcess)
-
setExpirationNotified
public void setExpirationNotified(boolean expirationNotified)
-
setImage
public void setImage(AdImage image)
Description copied from interface:ImageOwnerEither the single image or a de-normalized reference to the first image- Specified by:
setImagein interfaceImageOwner<BasicAd,AdImage>
-
setImages
public void setImages(List<AdImage> images)
Description copied from interface:ImageOwnerAssigns either all images or the first image if the owner has a single one- Specified by:
setImagesin interfaceImageOwner<BasicAd,AdImage>
-
setLastModified
public void setLastModified(Date lastModified)
-
setOwner
public void setOwner(User owner)
-
setPrice
public void setPrice(CurrencyAmount price)
-
setPromotionalPeriod
public void setPromotionalPeriod(DatePeriod promotionalPeriod)
-
setPromotionalPrice
public void setPromotionalPrice(BigDecimal promotionalPrice)
-
setPublicationPeriod
public void setPublicationPeriod(DatePeriod publicationPeriod)
-
setQuestions
public void setQuestions(Set<AdQuestion> questions)
-
setRemovedFromOwner
public void setRemovedFromOwner(boolean removedFromOwner)
-
setStatus
public void setStatus(AdStatus status)
-
-