java.lang.Object
com.inductiveautomation.ignition.common.resourcecollection.AbstractResource
All Implemented Interfaces:
Resource
Direct Known Subclasses:
ImmutableResource

public abstract class AbstractResource extends Object implements Resource
  • Field Details

    • collectionName

      protected final String collectionName
    • resourcePath

      protected final ResourcePath resourcePath
    • folder

      protected final boolean folder
    • unary

      protected final boolean unary
    • documentation

      protected final String documentation
    • attributes

      protected final com.google.common.collect.ImmutableMap<String,com.inductiveautomation.ignition.common.gson.JsonElement> attributes
    • applicationScope

      protected final int applicationScope
    • version

      protected final int version
    • restricted

      protected final boolean restricted
    • overridable

      protected final boolean overridable
  • Constructor Details

    • AbstractResource

      protected AbstractResource(String collectionName, ResourcePath resourcePath, int applicationScope, @Nullable String documentation, int version, boolean folder, boolean unary, boolean restricted, boolean overridable, Map<String,com.inductiveautomation.ignition.common.gson.JsonElement> attributes)
  • Method Details

    • getCollectionName

      public String getCollectionName()
      Description copied from interface: Resource
      Get the name of the ResourceCollection this resource belongs to. Note that if this resource was inherited, this collection name will be the name of the collection that was loaded up, not necessarily the collection that actually holds the definition of this resource.
      Specified by:
      getCollectionName in interface Resource
    • getResourcePath

      public ResourcePath getResourcePath()
      Specified by:
      getResourcePath in interface Resource
    • getApplicationScope

      public int getApplicationScope()
      Description copied from interface: Resource
      Get the application scope of this resource.
      Specified by:
      getApplicationScope in interface Resource
      Returns:
      the application scope of this resource.
      See Also:
    • getDocumentation

      public String getDocumentation()
      Specified by:
      getDocumentation in interface Resource
    • getVersion

      public int getVersion()
      Description copied from interface: Resource
      Get the version of this resource.

      The version number is not intended to track mutations to the resource like the legacy edit count, but rather, its interpretation and use is for the entities this resource type belongs to and so it can be used to reason about the contents of the resource, e.g. to distinguish between serialization formats.

      Specified by:
      getVersion in interface Resource
      Returns:
      the version of this resource.
    • isFolder

      public boolean isFolder()
      Specified by:
      isFolder in interface Resource
      Returns:
      true if this resource is a folder.
    • isUnary

      public boolean isUnary()
      Specified by:
      isUnary in interface Resource
    • isRestricted

      public boolean isRestricted()
      Specified by:
      isRestricted in interface Resource
      Returns:
      true if this resource is restricted to users of a certain role. Formerly known as "protected".
    • isOverridable

      public boolean isOverridable()
      Specified by:
      isOverridable in interface Resource
      Returns:
      true if this resource can be overridden by child projects.
    • getAttributes

      @Nonnull public com.google.common.collect.ImmutableMap<String,com.inductiveautomation.ignition.common.gson.JsonElement> getAttributes()
      Description copied from interface: Resource
      Get an immutable view of the attributes map.
      Specified by:
      getAttributes in interface Resource
      Returns:
      an immutable view of the attributes map.
    • getAttribute

      public Optional<com.inductiveautomation.ignition.common.gson.JsonElement> getAttribute(String key)
      Specified by:
      getAttribute in interface Resource
    • getResourceId

      public ResourceId getResourceId()
      Specified by:
      getResourceId in interface Resource
    • toString

      public String toString()
      Overrides:
      toString in class Object