Package org.opennms.core.config.api
Class JaxbListWrapper<T>
- java.lang.Object
-
- org.opennms.core.config.api.JaxbListWrapper<T>
-
- All Implemented Interfaces:
Serializable
,Iterable<T>
- Direct Known Subclasses:
AgentResponseCollection
,AlarmCollectionDTO
,AlarmSummaryCollection
,ApplicationDTOList
,AssetSuggestionsRestService.SuggestionList
,BusinessServiceDTOList
,DateCollection
,DeployedRequisitionStats
,DeployedStats
,EmailNorthbounderConfigurationResource.EmailDestinationList
,EventCollectionDTO
,FloatCollection
,ForeignSourceConfigRestService.ElementList
,ForeignSourceConfigRestService.SimplePluginConfigList
,FormFields
,GraphNameCollection
,IntegerCollection
,JavamailConfigurationResource.End2endConfigList
,JavamailConfigurationResource.ReadmailConfigList
,JavamailConfigurationResource.SendmailConfigList
,KscRestService.KscReportCollection
,LongCollection
,NodeDTOList
,NodeList
,OnmsAcknowledgmentCollection
,OnmsAlarmCollection
,OnmsApplicationList
,OnmsCategoryCollection
,OnmsEventCollection
,OnmsGroupList
,OnmsIpInterfaceList
,OnmsLocationAvailDefinitionList
,OnmsMetaDataList
,OnmsMinionCollection
,OnmsMonitoredServiceDetailList
,OnmsMonitoredServiceList
,OnmsMonitoringLocationDefinitionList
,OnmsMonitoringSystemCollection
,OnmsNodeList
,OnmsNotificationCollection
,OnmsOutageCollection
,OnmsSnmpInterfaceList
,OnmsUserList
,OutageSummaryCollection
,PrefabGraphCollection
,RequisitionAssetCollection
,RequisitionCategoryCollection
,RequisitionCollection
,RequisitionInterfaceCollection
,RequisitionMonitoredServiceCollection
,RequisitionNamesRestService.RequisitionCollection
,RequisitionNodeCollection
,ResourceDTOCollection
,RtcNodeList
,SearchPropertyCollection
,SnmpTrapNorthbounderConfigurationResource.ImportMappings
,SnmpTrapNorthbounderConfigurationResource.SnmpTrapSinkList
,StringCollection
,SyslogNorthbounderConfigurationResource.SyslogDestinationList
,UserDefinedLinkRestService.UserDefinedLinkCollection
public class JaxbListWrapper<T> extends Object implements Serializable, Iterable<T>
A simple list wrapper for ensuring lists of JAXB objects serialize correctly. You must annotate subclasses with
XmlRootElement
and then implementgetObjects()
with anXmlElement
annotation and a call to super.getObjects() so that it gets serialized properly.Example implementation:
\@XmlRootElement(name="thingies") public static class ThingyCollection extends JaxbListWrapper<Thingy> { private static final long serialVersionUID = 1L; public ThingyCollection() { super(); } public ThingyCollection(final Collection<? extends Thingy> thingies) { super(thingies); } \@XmlElement(name="thingy") public List<Thingy> getObjects() { return super.getObjects(); } }
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JaxbListWrapper()
JaxbListWrapper(Collection<? extends T> objects)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, T obj)
boolean
add(T obj)
boolean
addAll(int index, Collection<? extends T> objs)
boolean
addAll(Collection<? extends T> objs)
void
clear()
boolean
contains(Object obj)
boolean
containsAll(Collection<?> objs)
boolean
equals(Object obj)
T
get(int index)
Integer
getCount()
List<T>
getObjects()
Integer
getOffset()
Integer
getTotalCount()
int
hashCode()
int
indexOf(Object obj)
boolean
isEmpty()
Iterator<T>
iterator()
int
lastIndexOf(Object obj)
ListIterator<T>
listIterator()
ListIterator<T>
listIterator(int index)
T
remove(int index)
boolean
remove(Object obj)
boolean
removeAll(Collection<?> objs)
boolean
retainAll(Collection<?> objs)
T
set(int index, T obj)
void
setCount(Integer count)
void
setObjects(List<? extends T> objects)
void
setOffset(Integer offset)
void
setTotalCount(Integer totalCount)
int
size()
List<T>
subList(int fromIndex, int toIndex)
Object[]
toArray()
<T> T[]
toArray(T[] type)
String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
JaxbListWrapper
public JaxbListWrapper()
-
JaxbListWrapper
public JaxbListWrapper(Collection<? extends T> objects)
-
-
Method Detail
-
get
public T get(int index)
-
add
public boolean add(T obj)
-
getCount
public Integer getCount()
-
setCount
public void setCount(Integer count)
-
size
public int size()
-
getTotalCount
public Integer getTotalCount()
-
setTotalCount
public void setTotalCount(Integer totalCount)
-
getOffset
public Integer getOffset()
-
setOffset
public void setOffset(Integer offset)
-
add
public void add(int index, T obj)
-
addAll
public boolean addAll(Collection<? extends T> objs)
-
addAll
public boolean addAll(int index, Collection<? extends T> objs)
-
clear
public void clear()
-
contains
public boolean contains(Object obj)
-
containsAll
public boolean containsAll(Collection<?> objs)
-
indexOf
public int indexOf(Object obj)
-
isEmpty
public boolean isEmpty()
-
lastIndexOf
public int lastIndexOf(Object obj)
-
listIterator
public ListIterator<T> listIterator()
-
listIterator
public ListIterator<T> listIterator(int index)
-
remove
public boolean remove(Object obj)
-
remove
public T remove(int index)
-
removeAll
public boolean removeAll(Collection<?> objs)
-
retainAll
public boolean retainAll(Collection<?> objs)
-
toArray
public Object[] toArray()
-
toArray
public <T> T[] toArray(T[] type)
-
-