Class ListView<I,T>

java.lang.Object
com.appiancorp.type.system.ListView<I,T>
Type Parameters:
I - - the identifier type
T - - the facet type
Direct Known Subclasses:
TypedValueListView

@GwtCompatible public abstract class ListView<I,T> extends Object

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.

Any subclass of this should add the following Jaxb annotations:
  • Add @XmlElement(type=[Your concrete ListViewDataSubset implementation class].class, namespace=Type.APPIAN_NAMESPACE) getDataSubset() along with an @XmlSeeAlso({I.class,DataSubset<I>.class,T.class}) where I is the first type parameter to this class, DataSubset<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 Details

  • Constructor Details

    • ListView

      public ListView(ListViewDataSubset<I> dataSubset)
      Constructs a ListView with the given ListViewDataSubset and an empty list of Facets. Same as calling new ListView(dataSubset, null)
      Parameters:
      dataSubset - - the datasubset this ListView will be constructed with
    • ListView

      public ListView(ListViewDataSubset<I> dataSubset, List<Facet<T>> facets)
      Constructs a ListView with the given ListViewDataSubset and list of Facets.
      Parameters:
      dataSubset - - the datasubset this ListView will be constructed with
      facets - - the lsit of Facets this ListView will be constructed with
  • Method Details

    • getDataSubset

      public abstract ListViewDataSubset<I> getDataSubset()
      Returns the ListViewDataSubset.
      Returns:
      the ListViewDataSubset
    • setDataSubset

      protected abstract void setDataSubset(ListViewDataSubset<I> dataSubset)
    • getFacets

      public abstract List<Facet<T>> 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

      protected abstract void setFacets(List<Facet<T>> facets)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • multilineToString

      public static com.appian.core.base.ToStringFunction<ListView> multilineToString(int indent)
      Returns a ToStringFunction 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

      public static com.google.common.base.Equivalence<ListView> equalDataCheck()
      Returns a Equivalence 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