Class LicenseAndOrganisationCollator

java.lang.Object
org.apache.creadur.whisker.model.Visitor
org.apache.creadur.whisker.model.LicenseAndOrganisationCollator

public class LicenseAndOrganisationCollator extends Visitor
Collates licenses and organisations.
  • Constructor Details

    • LicenseAndOrganisationCollator

      public LicenseAndOrganisationCollator()
  • Method Details

    • getLicenses

      public Set<License> getLicenses()
      Gets the licenses collected.
      Returns:
      not null
    • getOrganisation

      public Set<Organisation> getOrganisation()
      Gets the organisations collected.
      Returns:
      not null
    • traverseResource

      public boolean traverseResource()
      Don't traverse resources.
      Overrides:
      traverseResource in class Visitor
      Returns:
      false
      See Also:
    • visit

      public void visit(WithLicense license)
      Visits WithLicense.
      Overrides:
      visit in class Visitor
      Parameters:
      license - not null
      See Also:
    • isOnlyLicense

      public boolean isOnlyLicense(License license)
      Was this the only license collected?
      Parameters:
      license - not null
      Returns:
      true when the collection contains just this license, false when no licenses or any other licenses were collected
    • visit

      public void visit(ByOrganisation byOrganisation)
      Overrides:
      visit in class Visitor
      Parameters:
      byOrganisation - not null
      See Also:
    • toString

      public String toString()
      Something useful for logging.
      Overrides:
      toString in class Object
      Returns:
      something for logging
      See Also:
    • isOnlyOrganisation

      public boolean isOnlyOrganisation(String primaryOrganisationId)
      Is there only one organisation collected with the given id?
      Parameters:
      primaryOrganisationId - not null
      Returns:
      true when only one organisation has been collected and it has the given id