Class WithinDirectory

java.lang.Object
org.apache.creadur.whisker.model.WithinDirectory
All Implemented Interfaces:
Comparable<WithinDirectory>, ContentElement

public class WithinDirectory extends Object implements Comparable<WithinDirectory>, ContentElement
Links resources expected within a directory in the distribution to licensing meta-data.
  • Constructor Details

    • WithinDirectory

      public WithinDirectory(String name, Collection<WithLicense> licenses, Collection<ByOrganisation> publicDomain)
      Constructs a description of a directory
      Parameters:
      name - directory name, not null
      licenses - resources contained, grouped by license applicable, not null
      publicDomain - resources in the public domain, grouped by responsible organisation
  • Method Details

    • getPublicDomain

      public Collection<ByOrganisation> getPublicDomain()
      Gets resources in the public domain, grouped by the organisation responsible.
      Returns:
      not null
    • getName

      public String getName()
      Gets the name of the directory described.
      Returns:
      not null
    • getLicenses

      public Collection<WithLicense> getLicenses()
      Gets resources contained, grouped by license applicable.
      Returns:
      not null
    • hashCode

      public int hashCode()
      Based on name.
      Overrides:
      hashCode in class Object
      Returns:
      hash code
      See Also:
    • equals

      public boolean equals(Object obj)
      Based on directory name.
      Overrides:
      equals in class Object
      Parameters:
      obj - possibly null
      Returns:
      true when directory names are equal, false otherwise
      See Also:
    • compareTo

      public int compareTo(WithinDirectory other)
      Based on name.
      Specified by:
      compareTo in interface Comparable<WithinDirectory>
      Returns:
      based on name
      See Also:
    • isNamed

      public boolean isNamed(String directoryName)
      Does the directory described have the given name?
      Parameters:
      directoryName - not null
      Returns:
      true when the name match that of this directory, false otherwise
    • accept

      public void accept(Visitor visitor)
      Accepts a visitor.
      Specified by:
      accept in interface ContentElement
      Parameters:
      visitor - possibly null