org.appng.core.domain

## Class ResourceImpl

- java.lang.Object
- - org.appng.core.domain.ResourceImpl

- All Implemented Interfaces:
    Closeable, Serializable, AutoCloseable, Identifiable<Integer>, Nameable, Named<Integer>, Resource, Versionable<Date>, Auditable<Integer>

      @Entity
      public class ResourceImpl
      extends Object
      implements Resource, Auditable<Integer>, Closeable

  Default `Resource`-implementation
  Author:
    Matthias Müller
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ResourceImpl()`
    `ResourceImpl(Application application, Resource resource)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `calculateChecksum()`
    `void` | `close()`
    `Application` | `getApplication()`
    `String` | `getAuditName()`
    `@NotNull byte[]` | `getBytes()` Returns the byte data of the `Resource`.
    `File` | `getCachedFile()` Returns a cached version of the `Resource`s file.
    `String` | `getCheckSum()` Returns the checksum of the byte data
    `String` | `getDescription()` Returns the description.
    `Integer` | `getId()` Returns the id.
    `String` | `getName()` Returns the name.
    `ResourceType` | `getResourceType()` Returns the type of this `Resource`.
    `int` | `getSize()` Returns the size (in bytes) of this `Resource`.
    `Date` | `getVersion()` Returns the version.
    `void` | `setApplication(Application application)`
    `void` | `setBytes(byte[] bytes)`
    `void` | `setCachedFile(File cachedFile)` Sets the cached version of the `Resource`s file.
    `void` | `setCheckSum(String checkSum)`
    `void` | `setDescription(String description)`
    `void` | `setId(Integer id)`
    `void` | `setName(String name)`
    `void` | `setResourceType(ResourceType type)`
    `void` | `setVersion(Date version)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ResourceImpl

          public ResourceImpl()

    - #### ResourceImpl

          public ResourceImpl(Application application,
                              Resource resource)

  - ### Method Detail

    - #### getId

          public Integer getId()

      Description copied from interface: `Identifiable`
      Returns the id.
      Specified by:
        `getId` in interface `Identifiable<Integer>`
      Returns:
        the id

    - #### setId

          public void setId(Integer id)

    - #### getName

          public String getName()

      Description copied from interface: `Nameable`
      Returns the name.
      Specified by:
        `getName` in interface `Nameable`
      Returns:
        the name

    - #### setName

          public void setName(String name)

    - #### getDescription

          public String getDescription()

      Description copied from interface: `Nameable`
      Returns the description.
      Specified by:
        `getDescription` in interface `Nameable`
      Returns:
        the description

    - #### setDescription

          public void setDescription(String description)

    - #### getVersion

          public Date getVersion()

      Description copied from interface: `Versionable`
      Returns the version.
      Specified by:
        `getVersion` in interface `Versionable<Date>`
      Returns:
        the version

    - #### setVersion

          public void setVersion(Date version)

    - #### getApplication

          public Application getApplication()

    - #### setApplication

          public void setApplication(Application application)

    - #### getResourceType

          public ResourceType getResourceType()

      Description copied from interface: `Resource`
      Returns the type of this `Resource`.
      Specified by:
        `getResourceType` in interface `Resource`
      Returns:
        the type

    - #### setResourceType

          public void setResourceType(ResourceType type)

    - #### getBytes

          @NotNull
          public @NotNull byte[] getBytes()

      Description copied from interface: `Resource`
      Returns the byte data of the `Resource`.
      Specified by:
        `getBytes` in interface `Resource`
      Returns:
        the byte data

    - #### setBytes

          public void setBytes(byte[] bytes)

    - #### getCheckSum

          public String getCheckSum()

      Description copied from interface: `Resource`
      Returns the checksum of the byte data
      Specified by:
        `getCheckSum` in interface `Resource`
      Returns:
        the checksum of the byte data

    - #### setCheckSum

          public void setCheckSum(String checkSum)

    - #### getCachedFile

          public File getCachedFile()

      Description copied from interface: `Resource`
      Returns a cached version of the `Resource`s file.
      Specified by:
        `getCachedFile` in interface `Resource`
      Returns:
        the cached file

    - #### setCachedFile

          public void setCachedFile(File cachedFile)

      Description copied from interface: `Resource`
      Sets the cached version of the `Resource`s file.
      Specified by:
        `setCachedFile` in interface `Resource`
      Parameters:
        `cachedFile` - the cached file

    - #### getSize

          public int getSize()

      Description copied from interface: `Resource`
      Returns the size (in bytes) of this `Resource`.
      Specified by:
        `getSize` in interface `Resource`
      Returns:
        the size (in bytes)

    - #### calculateChecksum

          public void calculateChecksum()

    - #### close

          public void close()

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`

    - #### getAuditName

          public String getAuditName()

      Specified by:
        `getAuditName` in interface `Auditable<Integer>`

Copyright © 2011–2023 aiticon GmbH. All rights reserved.