Class Directory

java.lang.Object
org.apache.creadur.whisker.scan.Directory
All Implemented Interfaces:
Comparable<Directory>

public class Directory extends Object implements Comparable<Directory>
Describes a directory.
  • Constructor Details

    • Directory

      public Directory()
  • Method Details

    • getName

      public String getName()
      Gets the directory name.
      Returns:
      the name
    • setName

      public Directory setName(String name)
      Sets the directory name.
      Parameters:
      name - the name to set
      Returns:
      this, not null
    • getContents

      public Set<String> getContents()
      Gets the directory contents.
      Returns:
      the contents
    • setContents

      public void setContents(Set<String> contents)
      Sets the directory contents.
      Parameters:
      contents - the contents to set
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      Returns:
      the hash code
      See Also:
    • equals

      public boolean equals(Object obj)
      Equal if and only if names are equal.
      Overrides:
      equals in class Object
      Parameters:
      obj - possibly null
      Returns:
      true when equal
      See Also:
    • toString

      public String toString()
      Suitable for logging.
      Overrides:
      toString in class Object
      Returns:
      not null
      See Also:
    • addResource

      public void addResource(String name)
      Registers a contained resource.
      Parameters:
      name - not null
    • compareTo

      public int compareTo(Directory other)
      Natural comparison based on name.
      Specified by:
      compareTo in interface Comparable<Directory>
      Parameters:
      other - another directory
      Returns:
      comparison
      See Also: