Package edu.byu.hbll.box
Class Facet
java.lang.Object
edu.byu.hbll.box.Facet
- All Implemented Interfaces:
Serializable
Represents a facet. Immutable.
- Author:
- Charles Draper
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
getName()
Returns the name of the facet.getValue()
Returns the value of the facet.group
(Collection<Facet> facets) Utility method for grouping facets by name.int
hashCode()
static Facet
Parses a facet value in the form of "NAME:VALUE".parse
(Collection<String> facets) Parses facet values in the form of "NAME:VALUE".toString()
static String
validateName
(String name) Validates a facet group name.
-
Constructor Details
-
Facet
Creates a newFacet
with the given name and value.- Parameters:
name
- name of the facet groupvalue
- value of the facet
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
toString
-
validateName
Validates a facet group name. Facet names must contain only characters in [0-9A-Za-z_].- Parameters:
name
- name of the facet group- Returns:
- whether or not the name is valid
-
parse
Parses a facet value in the form of "NAME:VALUE".- Parameters:
facet
- the facet value- Returns:
- the parsed facet
-
parse
Parses facet values in the form of "NAME:VALUE".- Parameters:
facets
- the facets to parse- Returns:
- the parsed facets
-
group
Utility method for grouping facets by name.- Parameters:
facets
- a collection of facets- Returns:
- a map of group name to a set of corresponding facets
-
getName
Returns the name of the facet.- Returns:
- the name of the facet
-
getValue
Returns the value of the facet.- Returns:
- the value of the facet.
-