Class AbstractResource
java.lang.Object
com.inductiveautomation.ignition.common.resourcecollection.AbstractResource
- All Implemented Interfaces:
Resource
- Direct Known Subclasses:
ImmutableResource
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final int
protected final com.google.common.collect.ImmutableMap<String,
com.inductiveautomation.ignition.common.gson.JsonElement> protected final String
protected final String
protected final boolean
protected final boolean
protected final ResourcePath
protected final boolean
protected final boolean
protected final int
Fields inherited from interface com.inductiveautomation.ignition.common.resourcecollection.Resource
DEFAULT_BACKUP_JSON_KEY, DEFAULT_DATA_KEY, DEFAULT_JSON_KEY, PLATFORM_MODULE_ID, UNARY_RESOURCE_NAME
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractResource
(String collectionName, ResourcePath resourcePath, int applicationScope, String documentation, int version, boolean folder, boolean unary, boolean restricted, boolean overridable, Map<String, com.inductiveautomation.ignition.common.gson.JsonElement> attributes) -
Method Summary
Modifier and TypeMethodDescriptionint
Get the application scope of this resource.Optional<com.inductiveautomation.ignition.common.gson.JsonElement>
getAttribute
(String key) com.google.common.collect.ImmutableMap<String,
com.inductiveautomation.ignition.common.gson.JsonElement> Get an immutable view of the attributes map.Get the name of theResourceCollection
this resource belongs to.int
Get the version of this resource.boolean
isFolder()
boolean
boolean
boolean
isUnary()
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.inductiveautomation.ignition.common.resourcecollection.Resource
copy, copy, copyWithAttribute, getContentDigest, getData, getData, getDataDigest, getDataKeys, getDataReader, getDataStream, getDefiningCollectionName, getDefiningCollectionNames, getFolderPath, getResourceName, getResourceSignature, getResourceType, isModuleFolder, isResourceTypeFolder, isSingletonResource, toBuilder
-
Field Details
-
collectionName
-
resourcePath
-
folder
protected final boolean folder -
unary
protected final boolean unary -
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
Description copied from interface:Resource
Get the name of theResourceCollection
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 interfaceResource
-
getResourcePath
- Specified by:
getResourcePath
in interfaceResource
-
getApplicationScope
public int getApplicationScope()Description copied from interface:Resource
Get the application scope of this resource.- Specified by:
getApplicationScope
in interfaceResource
- Returns:
- the application scope of this resource.
- See Also:
-
getDocumentation
- Specified by:
getDocumentation
in interfaceResource
-
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 interfaceResource
- Returns:
- the version of this resource.
-
isFolder
public boolean isFolder() -
isUnary
public boolean isUnary() -
isRestricted
public boolean isRestricted()- Specified by:
isRestricted
in interfaceResource
- 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 interfaceResource
- 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 interfaceResource
- Returns:
- an immutable view of the attributes map.
-
getAttribute
- Specified by:
getAttribute
in interfaceResource
-
getResourceId
- Specified by:
getResourceId
in interfaceResource
-
toString
-