Package edu.byu.hbll.box
Class Facet
- java.lang.Object
-
- edu.byu.hbll.box.Facet
-
- All Implemented Interfaces:
Serializable
public final class Facet extends Object implements Serializable
Represents a facet. Immutable.- Author:
- Charles Draper
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getName()
Returns the name of the facet.String
getValue()
Returns the value of the facet.static Map<String,Set<Facet>>
group(Collection<Facet> facets)
Utility method for grouping facets by name.int
hashCode()
static Facet
parse(String facet)
Parses a facet value in the form of "NAME:VALUE".static List<Facet>
parse(Collection<String> facets)
Parses facet values in the form of "NAME:VALUE".String
toString()
static String
validateName(String name)
Validates a facet group name.
-
-
-
Method Detail
-
validateName
public static String validateName(String name)
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
public static Facet parse(String facet)
Parses a facet value in the form of "NAME:VALUE".- Parameters:
facet
- the facet value- Returns:
- the parsed facet
-
parse
public static List<Facet> parse(Collection<String> facets)
Parses facet values in the form of "NAME:VALUE".- Parameters:
facets
- the facets to parse- Returns:
- the parsed facets
-
group
public static Map<String,Set<Facet>> group(Collection<Facet> facets)
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
public String getName()
Returns the name of the facet.- Returns:
- the name of the facet
-
getValue
public String getValue()
Returns the value of the facet.- Returns:
- the value of the facet.
-
-