com.atlassian.jira.rest.client.api
Class OptionalIterable<T>
java.lang.Object
com.atlassian.jira.rest.client.api.OptionalIterable<T>
- All Implemented Interfaces:
- Iterable<T>
public class OptionalIterable<T>
- extends Object
- implements Iterable<T>
Represent iterable which is optional (for example due to lack of field in old REST API version).
This iterable is intended to be not null, so you can always get items by using iterator. If you need
to check if value was actually provided then use isSupported().
- Since:
- v1.0
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OptionalIterable
public OptionalIterable(@Nullable
Iterable<T> iterable)
absent
public static <T> OptionalIterable<T> absent()
iterator
public Iterator<T> iterator()
- Specified by:
iterator in interface Iterable<T>
- Returns:
- iterator for original iterable if
isSupported() is true,
or empty iterator in other case.
isSupported
public boolean isSupported()
- Returns:
- true if server supports this field
Copyright © 2014 Atlassian. All Rights Reserved.