Class Facet.Category

  • Enclosing class:
    Facet

    public static class Facet.Category
    extends java.lang.Object

    Category of a facet, such as "Location, based on the metadata class X".

    Correspond to the definition of a category, not the value itself.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<Facet.Category> categories
      Sub categories, in case of a hierarchical definition.
      private java.lang.String label
      Label for this category.
      private java.lang.String queryStringParamName
      Name of the query string parameter for this category.
      private java.util.List<Facet.CategoryValue> values
      Values for this category.
    • Constructor Summary

      Constructors 
      Constructor Description
      Category​(java.lang.String label, java.lang.String queryStringParamName)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Facet.Category findDeepest​(java.util.List<java.lang.String> categoryParamNames)
      Recursively find the deepest category.
      java.util.List<Facet.Category> getCategories()
      Sub categories, in case of a hierarchical definition.
      java.lang.String getLabel()
      Label for this category.
      java.lang.String getQueryStringParamName()
      Name of the query string parameter for this category.
      java.util.List<Facet.CategoryValue> getValues()
      Values for this category.
      boolean hasValues()
      Recursively check if this category or any of its sub-categories has values.
      void setLabel​(java.lang.String label)
      Label for this category.
      void setQueryStringParamName​(java.lang.String queryStringParamName)
      Name of the query string parameter for this category.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • label

        private java.lang.String label
        Label for this category.
      • queryStringParamName

        private java.lang.String queryStringParamName
        Name of the query string parameter for this category. (Ex: f.Location|X).
      • categories

        private final java.util.List<Facet.Category> categories
        Sub categories, in case of a hierarchical definition.
    • Constructor Detail

      • Category

        public Category​(java.lang.String label,
                        java.lang.String queryStringParamName)
    • Method Detail

      • hasValues

        public boolean hasValues()
        Recursively check if this category or any of its sub-categories has values.
        Returns:
        true if this category or a nested one has at least one value.
      • findDeepest

        public Facet.Category findDeepest​(java.util.List<java.lang.String> categoryParamNames)
        Recursively find the deepest category.
        Parameters:
        categoryParamNames -
        Returns:
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getLabel

        public java.lang.String getLabel()
        Label for this category.
      • setLabel

        public void setLabel​(java.lang.String label)
        Label for this category.
      • getQueryStringParamName

        public java.lang.String getQueryStringParamName()
        Name of the query string parameter for this category. (Ex: f.Location|X).
      • setQueryStringParamName

        public void setQueryStringParamName​(java.lang.String queryStringParamName)
        Name of the query string parameter for this category. (Ex: f.Location|X).
      • getCategories

        public java.util.List<Facet.Category> getCategories()
        Sub categories, in case of a hierarchical definition.