Package com.atlassian.adf.model.node
Class Media.ExternalMedia
- java.lang.Object
-
- com.atlassian.adf.model.node.AbstractNode<N>
-
- com.atlassian.adf.model.node.Media.AbstractMedia<Media.ExternalMedia>
-
- com.atlassian.adf.model.node.Media.ExternalMedia
-
- All Implemented Interfaces:
Element,Media,Node,Marked<Media,MediaMark>,Fold3<Media.FileMedia,Media.LinkMedia,Media.ExternalMedia>
- Enclosing interface:
- Media
public static class Media.ExternalMedia extends Media.AbstractMedia<Media.ExternalMedia>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.atlassian.adf.model.node.AbstractNode
AbstractNode.ToStringHelper
-
Nested classes/interfaces inherited from interface com.atlassian.adf.model.node.Media
Media.AbstractMedia<N extends Media.AbstractMedia<N>>, Media.ExternalMedia, Media.FileMedia, Media.FileOrLinkMedia<T extends Media.FileOrLinkMedia<T>>, Media.LinkMedia, Media.MediaType, Media.Partial
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidappendMediaFields(AbstractNode.ToStringHelper buf)Media.ExternalMediacopy()Returns a deep copy of this element, including copies of any nodes or marks that it contains.Optional<Media.ExternalMedia>external()Optional<Media.FileMedia>file()<R> Rfold(Function<? super Media.FileMedia,? extends R> ifFile, Function<? super Media.LinkMedia,? extends R> ifLink, Function<? super Media.ExternalMedia,? extends R> ifExternal)booleanisExternal()booleanisFile()booleanisLink()Deprecated.Most of the support forlinkmedia no longer functions in the editor code base, so clients are unlikely to encounter it in the wild and should not use it in new ADF.Optional<Media.LinkMedia>link()protected booleanmediaEquals(Media.ExternalMedia other)protected intmediaHashCode()Map<String,?>toMap()Transforms this element to a map ofStringvalues to various basic object types suitable for direct rendering as JSON content.Media.MediaTypetype()Returns the media node's type.Stringurl()Returns theurlvalue for the external media.-
Methods inherited from class com.atlassian.adf.model.node.Media.AbstractMedia
accept, addCommonAttrs, alt, alt, appendNodeFields, border, border, border, border, elementType, height, height, ifExternal, ifFile, ifLink, link, link, linkMark, linkMark, linkMark, linkMark, mark, mark, markClass, marks, marks, markTypes, nodeEquals, nodeHashCode, parseCommonAttrs, size, validate, width, width
-
Methods inherited from class com.atlassian.adf.model.node.AbstractNode
appendPlainText, doubleEq, doubleHash, equals, hashCode, isSupported, mapWithType, numberEq, numberHash, self, toPlainText, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.atlassian.adf.model.Element
isSupported
-
Methods inherited from interface com.atlassian.adf.model.node.Node
appendPlainText, toPlainText
-
-
-
-
Method Detail
-
copy
public Media.ExternalMedia copy()
Description copied from interface:ElementReturns a deep copy of this element, including copies of any nodes or marks that it contains. The copy will not necessarily be in exactly the same state as the original in some cases. For example, atextnode that is used inside acodeBlockwill have the ability to use marks on it disabled, but a copy made of the text node using this method will not similarly disallow marks unless it is also added to a content node with those same restrictions.Implementations notes:
- Implementations should narrow the return type.
- Implementations should
return thisif the element is immutable. The@Immutableannotation should be used on the class to offer additional confirmation of this intent. - Implementations should
return parse(toMap())if they have state. - While there may be cases where it is worthwhile to do something more efficient than
the conversion to a map and back, this is discouraged because it would add yet another
fragile piece of code that breaks when new data is added to the node. The
parseandtoMapmethods already have to be updated in these circumstances, so it makes sense to take advantage of that.
- Returns:
- a copy of this element, or
thisif the element is immutable anyway
-
url
public String url()
Returns theurlvalue for the external media.
-
type
public Media.MediaType type()
Description copied from interface:MediaReturns the media node's type.- Returns:
- the media node's type.
-
fold
public <R> R fold(Function<? super Media.FileMedia,? extends R> ifFile, Function<? super Media.LinkMedia,? extends R> ifLink, Function<? super Media.ExternalMedia,? extends R> ifExternal)
-
file
public Optional<Media.FileMedia> file()
-
link
public Optional<Media.LinkMedia> link()
-
external
public Optional<Media.ExternalMedia> external()
-
isFile
public boolean isFile()
-
isLink
@Deprecated public boolean isLink()
Deprecated.Most of the support forlinkmedia no longer functions in the editor code base, so clients are unlikely to encounter it in the wild and should not use it in new ADF.
-
isExternal
public boolean isExternal()
-
toMap
public Map<String,?> toMap()
Description copied from interface:ElementTransforms this element to a map ofStringvalues to various basic object types suitable for direct rendering as JSON content.- Returns:
- the map representation of this ADF element
-
mediaEquals
protected boolean mediaEquals(Media.ExternalMedia other)
- Specified by:
mediaEqualsin classMedia.AbstractMedia<Media.ExternalMedia>
-
mediaHashCode
protected int mediaHashCode()
- Specified by:
mediaHashCodein classMedia.AbstractMedia<Media.ExternalMedia>
-
appendMediaFields
protected void appendMediaFields(AbstractNode.ToStringHelper buf)
- Specified by:
appendMediaFieldsin classMedia.AbstractMedia<Media.ExternalMedia>
-
-