java.lang.Object
org.broadleafcommerce.common.media.domain.MediaImpl
All Implemented Interfaces:
Serializable, MultiTenantCloneable<MediaImpl>, Media, Wrappable

@Entity public class MediaImpl extends Object implements Media, MultiTenantCloneable<MediaImpl>
See Also:
  • Field Details

    • id

      protected Long id
    • url

      protected String url
    • title

      protected String title
    • altText

      protected String altText
    • tags

      protected String tags
  • Constructor Details

    • MediaImpl

      public MediaImpl()
  • Method Details

    • getId

      public Long getId()
      Specified by:
      getId in interface Media
    • setId

      public void setId(Long id)
      Specified by:
      setId in interface Media
    • getUrl

      public String getUrl()
      Specified by:
      getUrl in interface Media
    • setUrl

      public void setUrl(String url)
      Specified by:
      setUrl in interface Media
    • getTitle

      public String getTitle()
      Specified by:
      getTitle in interface Media
    • setTitle

      public void setTitle(String title)
      Specified by:
      setTitle in interface Media
    • getAltText

      public String getAltText()
      Specified by:
      getAltText in interface Media
    • setAltText

      public void setAltText(String altText)
      Specified by:
      setAltText in interface Media
    • getTags

      public String getTags()
      Specified by:
      getTags in interface Media
    • setTags

      public void setTags(String tags)
      Specified by:
      setTags in interface Media
    • isUnwrappableAs

      public boolean isUnwrappableAs(Class unwrapType)
      Description copied from interface: Wrappable
      Can this wrapped item be unwrapped as the indicated type?
      Specified by:
      isUnwrappableAs in interface Wrappable
      Parameters:
      unwrapType - The type to check.
      Returns:
      True/false.
    • unwrap

      public <T> T unwrap(Class<T> unwrapType)
      Description copied from interface: Wrappable
      Get the wrapped delegate item
      Specified by:
      unwrap in interface Wrappable
      Parameters:
      unwrapType - The java type as which to unwrap this instance.
      Returns:
      The unwrapped reference
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • createOrRetrieveCopyInstance

      public <G extends MediaImpl> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException
      Description copied from interface: MultiTenantCloneable
      Clone this entity for the purpose of multiple tenancy. Note, extending classes should follow this pattern:

      public CreateResponse<MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException { CreateResponse<MyClass> createResponse = super.createOrRetrieveCopyInstance(context); if (createResponse.isAlreadyPopulated()) { return createResponse; } MyClass myClone = createResponse.getClone();

      //copy extended field values on myClone here

      return createResponse; }

      Support should also be added for @Embeddable classes that contribute fields (collections or basic) to a cloneable entity:

      public CreateResponse<G extends MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException { CreateResponse createResponse = context.createOrRetrieveCopyInstance(this); MyClass myClone = createResponse.getClone();

      //copy extended field values on myClone here

      return createResponse; }

      Specified by:
      createOrRetrieveCopyInstance in interface MultiTenantCloneable<MediaImpl>
      Parameters:
      context - a context object providing persistence and library functionality for copying entities
      Returns:
      the resulting copy container, possibly already persisted
      Throws:
      CloneNotSupportedException - if there's a problem detected with the cloning configuration