Package de.espirit.firstspirit.agency
Interface ImageAgent
public interface ImageAgent
Agent providing image containers.
- Since:
- 5.2.5
-
Field Summary
Modifier and TypeFieldDescriptionstatic final SpecialistType<ImageAgent>
Agent providing image containers. -
Method Summary
Modifier and TypeMethodDescriptiongetImageFromIcon
(@Nullable Icon icon) Creates anImage
container based on the given icon object.getImageFromMedia
(@Nullable Media media) Creates anImage
container based on the given media object.getImageFromUrl
(@Nullable String url) Creates anImage
container based on the given url pointing to some image.
-
Field Details
-
TYPE
Agent providing image containers.- Since:
- 5.2.5
-
-
Method Details
-
getImageFromUrl
@Contract("null -> null; !null -> !null") @Nullable @Nullable Image<String> getImageFromUrl(@Nullable @Nullable String url) Creates anImage
container based on the given url pointing to some image. The image URL should be absolute. Non-absolute URLs will be resolved relative to the application directory of the respective client.- Parameters:
url
- The URL pointing to an image.- Returns:
- A newly created Image container or
null
, if url isnull
. - Throws:
UnsupportedOperationException
- if the agent's context does not support url based images.- Since:
- 5.2.5
-
getImageFromIcon
@Contract("null -> null; !null -> !null") @Nullable @Nullable Image<Icon> getImageFromIcon(@Nullable @Nullable Icon icon) Creates anImage
container based on the given icon object.- Parameters:
icon
- The icon.- Returns:
- A newly created Image container or
null
, if icon isnull
. - Throws:
UnsupportedOperationException
- if the agent's context does not support icon based images.- Since:
- 5.2.5
-
getImageFromMedia
@Contract("null -> null; !null -> !null") @Nullable @Nullable Image<Media> getImageFromMedia(@Nullable @Nullable Media media) Creates anImage
container based on the given media object.- Parameters:
media
- The media.- Returns:
- A newly created Image container or
null
, if media isnull
. - Since:
- 5.2.416
-