make ChangesetPaginigResult iterable

This commit is contained in:
Sebastian Sdorra
2011-09-16 10:25:30 +02:00
parent 2cbde2fd17
commit 5f876c7da9

View File

@@ -35,6 +35,7 @@ package sonia.scm.repository;
//~--- JDK imports ------------------------------------------------------------ //~--- JDK imports ------------------------------------------------------------
import java.util.Iterator;
import java.util.List; import java.util.List;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
@@ -49,7 +50,7 @@ import javax.xml.bind.annotation.XmlRootElement;
*/ */
@XmlRootElement(name = "changeset-paging") @XmlRootElement(name = "changeset-paging")
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class ChangesetPagingResult public class ChangesetPagingResult implements Iterable<Changeset>
{ {
/** /**
@@ -71,6 +72,28 @@ public class ChangesetPagingResult
this.changesets = changesets; this.changesets = changesets;
} }
//~--- methods --------------------------------------------------------------
/**
* Method description
*
*
* @return
* @since 1.8
*/
@Override
public Iterator<Changeset> iterator()
{
Iterator<Changeset> it = null;
if (changesets != null)
{
it = changesets.iterator();
}
return it;
}
//~--- get methods ---------------------------------------------------------- //~--- get methods ----------------------------------------------------------
/** /**