Package com.atlassian.adf.model.node
Class Media.FileOrLinkMedia<T extends Media.FileOrLinkMedia<T>>
- java.lang.Object
-
- com.atlassian.adf.model.node.AbstractNode<N>
-
- com.atlassian.adf.model.node.Media.AbstractMedia<T>
-
- com.atlassian.adf.model.node.Media.FileOrLinkMedia<T>
-
- All Implemented Interfaces:
Element,Media,Node,InternalMediaNode,Marked<Media,MediaMark>,Fold3<Media.FileMedia,Media.LinkMedia,Media.ExternalMedia>
- Direct Known Subclasses:
Media.FileMedia,Media.LinkMedia
- Enclosing interface:
- Media
public abstract static class Media.FileOrLinkMedia<T extends Media.FileOrLinkMedia<T>> extends Media.AbstractMedia<T> implements InternalMediaNode
-
-
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
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringcollectionprotected Stringidprotected StringoccurrenceKey-
Fields inherited from class com.atlassian.adf.model.node.Media.AbstractMedia
alt, height, width
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendMediaFields(AbstractNode.ToStringHelper buf)Stringcollection()Returns the media node's collection ID.Tcollection(String collection)Replaces thecollectionID that was set when the node was constructed.Optional<Media.ExternalMedia>external()Stringid()Returns the media node's ID.Tid(String id)Replaces theidthat was set when the node was constructed.booleanisExternal()protected booleanmediaEquals(T other)protected intmediaHashCode()Optional<String>occurrenceKey()Returns the media node's occurrence key, if set.ToccurrenceKey(String occurrenceKey)Sets the occurrence key for this media item.Map<String,?>toMap()Transforms this element to a map ofStringvalues to various basic object types suitable for direct rendering as JSON content.-
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
elementType, isSupported, validate
-
Methods inherited from interface com.atlassian.adf.model.node.type.InternalMediaNode
isFile, isLink
-
Methods inherited from interface com.atlassian.adf.model.node.Media
file, fold, isFile, isLink, link, type
-
Methods inherited from interface com.atlassian.adf.model.node.Node
appendPlainText, toPlainText
-
-
-
-
Method Detail
-
id
public T id(String id)
Replaces theidthat was set when the node was constructed.In most cases, this library does not allow the modification of any of the values
- Specified by:
idin interfaceInternalMediaNode- Parameters:
id- the newidfor this media node- Returns:
this
-
collection
public T collection(@Nullable String collection)
Replaces thecollectionID that was set when the node was constructed.- Specified by:
collectionin interfaceInternalMediaNode- Parameters:
collection- the newcollectionfor this media node- Returns:
this
-
id
public String id()
Returns the media node's ID.- Specified by:
idin interfaceInternalMediaNode- Returns:
- the media node's ID.
-
collection
public String collection()
Returns the media node's collection ID.- Specified by:
collectionin interfaceInternalMediaNode- Returns:
- the media node's collection ID.
-
occurrenceKey
public Optional<String> occurrenceKey()
Returns the media node's occurrence key, if set.- Specified by:
occurrenceKeyin interfaceInternalMediaNode- Returns:
- the media node's occurrence key, or
empty()if not set.
-
occurrenceKey
public T occurrenceKey(@Nullable String occurrenceKey)
Sets the occurrence key for this media item. Although this attribute is optional, it must be set to enable deletion of files from a collection.- Specified by:
occurrenceKeyin interfaceInternalMediaNode- Parameters:
occurrenceKey- the occurrence key value- Returns:
this
-
external
public Optional<Media.ExternalMedia> external()
-
isExternal
public boolean isExternal()
- Specified by:
isExternalin interfaceMedia
-
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.
-
mediaEquals
protected final boolean mediaEquals(T other)
- Specified by:
mediaEqualsin classMedia.AbstractMedia<T extends Media.FileOrLinkMedia<T>>
-
mediaHashCode
protected final int mediaHashCode()
- Specified by:
mediaHashCodein classMedia.AbstractMedia<T extends Media.FileOrLinkMedia<T>>
-
appendMediaFields
protected final void appendMediaFields(AbstractNode.ToStringHelper buf)
- Specified by:
appendMediaFieldsin classMedia.AbstractMedia<T extends Media.FileOrLinkMedia<T>>
-
-