Class AbstractResourceEntry

java.lang.Object
dev.getelements.elements.rt.transact.AbstractResourceEntry
All Implemented Interfaces:
ResourceEntry, AutoCloseable
Direct Known Subclasses:
NullResourceEntry, UnixFSResourceEntryBase

public abstract class AbstractResourceEntry extends Object implements ResourceEntry
  • Field Details

  • Constructor Details

  • Method Details

    • isOriginalContents

      public boolean isOriginalContents()
      Description copied from interface: ResourceEntry
      Return true if the content is the original content.
      Specified by:
      isOriginalContents in interface ResourceEntry
      Returns:
      true if the content is original.
    • isOriginalReversePaths

      public boolean isOriginalReversePaths()
      Description copied from interface: ResourceEntry
      Checks if the list of reverse links are the original set of reverse links.
      Specified by:
      isOriginalReversePaths in interface ResourceEntry
      Returns:
      true if the links are original
    • findResourceId

      public Optional<ResourceId> findResourceId()
      Description copied from interface: ResourceEntry
      Finds the ResourceId associated with the node, or a result equivalent to Optional.empty() if no such resource id exists.
      Specified by:
      findResourceId in interface ResourceEntry
      Returns:
      an Optional<ResourceId> containing the ResourceId
    • getReversePathsImmutable

      public Set<Path> getReversePathsImmutable()
      Description copied from interface: ResourceEntry
      Gets the internal immutable list of reverse links. Will always return an empty Set if no links exist.
      Specified by:
      getReversePathsImmutable in interface ResourceEntry
      Returns:
      the reverse links, never null.
    • link

      public boolean link(Path path)
      Description copied from interface: ResourceEntry
      Links this ResourceEntry for the supplied Path.
      Specified by:
      link in interface ResourceEntry
      Parameters:
      path - the Path to unlink
      Returns:
    • unlink

      public boolean unlink(Path path)
      Description copied from interface: ResourceEntry
      Unlinks this ResourceEntry for the supplied Path.
      Specified by:
      unlink in interface ResourceEntry
      Parameters:
      path - the Path to unlink
      Returns:
      true if the collection changed as the result of this operation
    • updateResourceContents

      public ResourceContents updateResourceContents()
      Description copied from interface: ResourceEntry
      Updates the contents of this ResourceEntry by overriding the supplied
      Specified by:
      updateResourceContents in interface ResourceEntry
      Returns:
      ResourceContents the contents
    • delete

      public boolean delete()
      Description copied from interface: ResourceEntry
      Flags this entry for removal returning the entry to absent state. If this entry is absent this will have no effect and the method will return false. Additionally, the operational strategy associated with this entry may opt to do nothing and return false as well.
      Specified by:
      delete in interface ResourceEntry
      Returns:
      true if clearing this entry had any effect