Package com.appiancorp.type.system
Class ListView<I,T>
java.lang.Object
com.appiancorp.type.system.ListView<I,T>
- Type Parameters:
I
- - the identifier typeT
- - the facet type
- Direct Known Subclasses:
TypedValueListView
This class is available as a preview of functionality that will be added to the supported public API in a future release. While it is in the preview phase, it is subject to change or removal without deprecation or notice. Although notice of change is not guaranteed, we will try to let developers know of major changes through announcements in release notes.
A ListView is a data structure geared toward presenting a set of data with additional information about
how the data can be filtered. It contains a ListViewDataSubset
of ListViewItem
objects
and a list of Facet
objects that define how the underlying data can be filtered.
- Add
@XmlElement(type=[Your concrete ListViewDataSubset implementation class].class, namespace=Type.APPIAN_NAMESPACE)
getDataSubset()
along with an@XmlSeeAlso({I.class,DataSubset
where I is the first type parameter to this class, DataSubset<I>
.class,T.class})<I>
is an implementing class of DataSubset using I, and T is the second type parameter to this class. - Add
@XmlRootElement(namespace=Type.APPIAN_NAMESPACE, name=ListView.XML_ROOT_ELEMENT)
annotation to the class - Add
@XmlType(namespace = [Your Namespace], propOrder={"dataSubset", "facets"})
annotation to the class
For example:
@XmlRootElement(namespace=Type.APPIAN_NAMESPACE, name=ListView.XML_ROOT_ELEMENT)
@XmlType(namespace=[Your Namespace], propOrder = {"dataSubset", "facets"})
@XmlSeeAlso({Person.class, Adress.class})
public static class PersonListView extends ListView<Person, Address>
{
private ListViewDataSubset<Person>
dataSubset;
private List<Facet<Address>>
facets;
public PersonListView(ListViewDataSubset ) {}
@Override
@XmlElement(type=PersonListViewDataSubset.class, namespace=[Your Namespace])
public ListViewDataSubset<Person>
getDataSubset() {
return dataSubset;
}
@Override
protected void setDataSubset(ListViewDataSubset<Person>
dataSubset) {
this.dataSubset = dataSubset;
}
@Override
@XmlElement(type=Facet.class, namespace=[Your Namespace])
public List<Facet<Address>>
getFacets() {
return facets;
}
@Override
protected void setFacets(List<Facet<Address>>
facets) {
this.facets = facets;
}
}
-
Field Summary
-
Constructor Summary
ConstructorDescriptionListView
(ListViewDataSubset<I> dataSubset) Constructs a ListView with the givenListViewDataSubset
and an empty list of Facets.Constructs a ListView with the givenListViewDataSubset
and list of Facets. -
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.common.base.Equivalence<ListView>
Returns aEquivalence
object that can be used to determine if two ListView objects are equal.abstract ListViewDataSubset<I>
Returns theListViewDataSubset
.Returns the facets that are applicable to the current (possibly filtered) data set.static com.appian.core.base.ToStringFunction<ListView>
multilineToString
(int indent) Returns aToStringFunction
that can be used to generate the multiline String representation of a ListViewprotected abstract void
setDataSubset
(ListViewDataSubset<I> dataSubset) protected abstract void
toString()
-
Field Details
-
XML_ROOT_ELEMENT
- See Also:
-
LOCAL_PART
- See Also:
-
QNAME
-
-
Constructor Details
-
ListView
Constructs a ListView with the givenListViewDataSubset
and an empty list of Facets. Same as callingnew ListView(dataSubset, null)
- Parameters:
dataSubset
- - the datasubset this ListView will be constructed with
-
ListView
Constructs a ListView with the givenListViewDataSubset
and list of Facets.- Parameters:
dataSubset
- - the datasubset this ListView will be constructed withfacets
- - the lsit of Facets this ListView will be constructed with
-
-
Method Details
-
getDataSubset
Returns theListViewDataSubset
.- Returns:
- the ListViewDataSubset
-
setDataSubset
-
getFacets
Returns the facets that are applicable to the current (possibly filtered) data set. The order is significant -- facets that are most relevant for an end user come first.- Returns:
- the list of Facets
-
setFacets
-
toString
-
multilineToString
Returns aToStringFunction
that can be used to generate the multiline String representation of a ListView- Parameters:
indent
- - number of spaces to increment each level of indentation- Returns:
- a ToStringFunction object to get the multiline string representation of a ListView
-
equalDataCheck
Returns aEquivalence
object that can be used to determine if two ListView objects are equal. This Equivalence object's equivalent(ListView lv1, ListView lv2) method should be used to determine Equality instead of equals()- Returns:
- an
Equivalence
object to check if two ListView objects are equal
-