Package com.atlassian.bamboo.utils
Class BambooOptionals
java.lang.Object
com.atlassian.bamboo.utils.BambooOptionals
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
Retrieves the optional content.static <T> Stream<T>
Converts the given Optional to a Streamstatic <T> void
withPresent
(Optional<T> o, Consumer<? super T> consumer, String errorMessage) Applies the consumer to the optional value.
-
Method Details
-
stream
Converts the given Optional to a Stream -
get
Retrieves the optional content. If it's not present throws ISE with the supplied error mesage. -
withPresent
public static <T> void withPresent(Optional<T> o, Consumer<? super T> consumer, String errorMessage) Applies the consumer to the optional value. If the value is not present throws ISE with the supplied error message.
-