java.lang.Object
java.lang.Record
com.inductiveautomation.ignition.common.resourcecollection.ResourceType
Record Components:
moduleId - the module ID of the module this resource type belongs to.
typeId - the type ID of the Resource; null for the resource that represents the module root folder.
All Implemented Interfaces:
Serializable

public record ResourceType(@Nonnull String moduleId, @Nullable String typeId) extends Record implements Serializable
See Also:
  • Constructor Details

    • ResourceType

      public ResourceType(@Nonnull String moduleId, @Nullable String typeId)
      Creates an instance of a ResourceType record class.
      Parameters:
      moduleId - the value for the moduleId record component
      typeId - the value for the typeId record component
  • Method Details

    • rootPath

      public ResourcePath rootPath()
      Returns:
      the ResourcePath for a resource to be placed in the module root. Applicable for root folders and singleton resources.
    • subPath

      public ResourcePath subPath(String path)
      Creates a ResourcePath for a child descendent resource of this type, possibly nested within subfolders
      Parameters:
      path - the path of the child resource. Will be parsed as a string path, e.g. "folder1/folder2/resourceName"
    • childPath

      public ResourcePath childPath(String name)
      Creates a ResourcePath for a direct named child of this type.
      Parameters:
      name - Name of the child resource. Will not be parsed, e.g. a value of "foo/bar" will not be parsed as "bar in a folder named foo" but rather "a child named 'foo/bar'"
    • childOrSubPath

      public ResourcePath childOrSubPath(@Nullable ResourcePath potentialFolder, String path)
    • matches

      public boolean matches(ChangeOperation op)
    • equals

      public boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • toFilter

      public ResourceFilter toFilter()
      Returns:
      a ResourceFilter that matches only this resource type.
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • moduleId

      @Nonnull public String moduleId()
      Returns the value of the moduleId record component.
      Returns:
      the value of the moduleId record component
    • typeId

      @Nullable public String typeId()
      Returns the value of the typeId record component.
      Returns:
      the value of the typeId record component