Package nl.vpro.domain
Interface TextualObjectUpdate<T extends TypedText,D extends TypedText,TO extends TextualObjectUpdate<T,D,TO>>
-
- Type Parameters:
T
- The type of 'titles' in this object.D
- The type of 'descriptions'.TO
- The type ofself()
which is returned by several setters, so they can easily be chained
- All Known Subinterfaces:
LocalizedObject<T,D,WS,TR,TO>
,Media<T>
,TextualObject<T,D,TO>
- All Known Implementing Classes:
AbstractTextualObject
,AbstractTextualObjectUpdate
,BasicTextualObject
,BasicTextualUpdate
,Group
,GroupUpdate
,MediaObject
,MediaObjectTranslation
,MediaUpdate
,Program
,ProgramUpdate
,ScheduleEvent
,ScheduleEventUpdate
,Segment
,SegmentUpdate
public interface TextualObjectUpdate<T extends TypedText,D extends TypedText,TO extends TextualObjectUpdate<T,D,TO>>
An object that has titles and descriptions, which are typed, but not necessary owned (unlikeTextualObject
). This means that the object generally is used to update 'TextualObjects', since the user updating is associated with only oneOwnerType
.- Since:
- 5.3
- Author:
- Michiel Meeuwissen
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default TO
addDescription(@Nullable String description, @NonNull TextualType type)
default TO
addDescription(D description)
default TO
addTitle(String title, @NonNull TextualType type)
default TO
addTitle(T title)
default D
findDescription(@NonNull TextualType type)
default T
findTitle(@NonNull TextualType type)
default String
getAbbreviatedTitle()
BiFunction<String,TextualType,D>
getDescriptionCreator()
SortedSet<D>
getDescriptions()
default Locale
getLanguage()
Describes in which language the contained text objects are.default String
getLexicoTitle()
Return the 'lexicographic title'.default String
getLongDescription()
Returns the description with textual type 'LONG' if there is one.default String
getMainDescription()
Returns the first available description.default String
getMainTitle()
default String
getOriginalTitle()
default String
getShortDescription()
default String
getShortTitle()
default String
getSubDescription()
default String
getSubTitle()
Retrieves the first sub- or episode title.BiFunction<String,TextualType,T>
getTitleCreator()
How to create an instance of a title.SortedSet<T>
getTitles()
default String
getWorkTitle()
default boolean
hasDescriptions()
Default implementation based ongetDescriptions()
, you may want to override this, if getDescriptions may modify the object (it is e.g.default boolean
hasTitles()
Default implementation based ongetTitles()
, you may want to override this, if getTitles may modify the object (it is e.g.default boolean
removeDescription(D description)
default boolean
removeDescription(TextualType type)
default boolean
removeTitle(T title)
default TO
self()
default TO
setDescription(@Nullable Supplier<String> up, @NonNull TextualType type)
Updates a description with aSupplier
, if at least the given supplier is not null.default void
setDescription(String description, @NonNull TextualType type)
Sets description if already set, otherwiseaddDescription(String, TextualType)
void
setDescriptions(SortedSet<D> descriptions)
default void
setLongDescription(String description)
default void
setMainDescription(String description)
default void
setMainTitle(String title)
default TO
setTitle(@Nullable Supplier<String> up, @NonNull TextualType type)
Updates a title with aSupplier
, if at least the given supplier is not null.default void
setTitle(String title, @NonNull TextualType type)
Sets title if already set, otherwiseaddTitle(String, TextualType)
void
setTitles(SortedSet<T> titles)
-
-
-
Method Detail
-
getLanguage
default Locale getLanguage()
Describes in which language the contained text objects are. This defaults toLocales.DUTCH
.
-
getTitleCreator
BiFunction<String,TextualType,T> getTitleCreator()
How to create an instance of a title. This makes a lot of default methods possible.- Since:
- 5.5
-
addTitle
default TO addTitle(String title, @NonNull TextualType type)
-
setTitle
default void setTitle(String title, @NonNull TextualType type)
Sets title if already set, otherwiseaddTitle(String, TextualType)
- Since:
- 5.11
-
setTitle
default TO setTitle(@Nullable Supplier<String> up, @NonNull TextualType type)
Updates a title with aSupplier
, if at least the given supplier is not null.
-
hasTitles
default boolean hasTitles()
Default implementation based ongetTitles()
, you may want to override this, if getTitles may modify the object (it is e.g. required by jaxb that this will never returnnull
-
removeTitle
default boolean removeTitle(T title)
-
self
default TO self()
-
findTitle
default T findTitle(@NonNull TextualType type)
-
getMainTitle
default String getMainTitle()
-
setMainTitle
default void setMainTitle(String title)
-
getSubTitle
default String getSubTitle()
Retrieves the first sub- or episode title. MIS distributes episode titles. For internal use this episode title is handled as a subtitle.- Returns:
- - the first subtitle
-
getShortTitle
default String getShortTitle()
-
getOriginalTitle
default String getOriginalTitle()
-
getWorkTitle
default String getWorkTitle()
-
getLexicoTitle
default String getLexicoTitle()
Return the 'lexicographic title'. This is the title where the object normally would be sorted on. This defaults togetMainTitle()
if no explicit value was set. If an explicit value is set, it may e.g. be the same asgetMainTitle()
but with leading articles ommitted.
-
getAbbreviatedTitle
default String getAbbreviatedTitle()
- Since:
- 2.1
-
setDescription
default void setDescription(String description, @NonNull TextualType type)
Sets description if already set, otherwiseaddDescription(String, TextualType)
- Since:
- 5.11
-
setDescription
default TO setDescription(@Nullable Supplier<String> up, @NonNull TextualType type)
Updates a description with aSupplier
, if at least the given supplier is not null.
-
getDescriptionCreator
BiFunction<String,TextualType,D> getDescriptionCreator()
- Since:
- 5.5
-
addDescription
default TO addDescription(@Nullable String description, @NonNull TextualType type)
-
hasDescriptions
default boolean hasDescriptions()
Default implementation based ongetDescriptions()
, you may want to override this, if getDescriptions may modify the object (it is e.g. required by hibernate that this will never returnnull
-
removeDescription
default boolean removeDescription(D description)
-
removeDescription
default boolean removeDescription(TextualType type)
-
findDescription
default D findDescription(@NonNull TextualType type)
-
getMainDescription
default String getMainDescription()
Returns the first available description. Probably the 'MAIN' description.
-
setMainDescription
default void setMainDescription(String description)
-
getLongDescription
default String getLongDescription()
Returns the description with textual type 'LONG' if there is one. Otherwise, returnsgetMainDescription()
-
setLongDescription
default void setLongDescription(String description)
-
getSubDescription
default String getSubDescription()
-
getShortDescription
default String getShortDescription()
-
-