Class Title
- All Implemented Interfaces:
Serializable
,CharSequence
,Comparable<TypedText>
,Supplier<String>
,Child<MediaObject>
,Identifiable<Long>
,nl.vpro.domain.media.support.MutableOwnable
,nl.vpro.domain.media.support.Ownable
,Typable<TextualType>
,OwnedText
,TypedText
MediaObject
can have more than one title which should differ in type and
owner.
To some extent a titles type describes a usage scenario. In most cases the main title will be used.
The title owner describes the origin of the title. Several media suppliers provide their own titles. To prevent conflicts while updating incoming data, all titles are stored for later usage. With the restriction that there are no titles t1 and t2 such that t1.equals(t2).
This class confirms to a natural ordering consistent with equals based on its type and owner. Beware of the fact that the title value itself has no part in the ordering algorithm. Two titles are equal if their owner and type are equal. When adding a title to a SortedSet which already contains an equal title, the added title automatically replaces the existing title.
The ordering of titles is dictated by the order (ordinal numbers) of the enum values for a titles type and ownertype.
- Since:
- 0.4
- Author:
- Roelof Jan Koekoek
- See Also:
-
TextualType
OwnerType
- Serialized Form
-
Field Summary
Modifier and TypeFieldDescriptionprotected MediaObject
protected @NotNull(message="{nl.vpro.constraints.NotNull}") @Size(min=1,message="{nl.vpro.constraints.text.Size.min}") @Size(max=255,message="{nl.vpro.constraints.text.Size.max}") @NoHtml String
Fields inherited from class nl.vpro.domain.AbstractOwnedText
owner, type
-
Constructor Summary
ConstructorDescriptionTitle()
Title
(@NonNull String title, @NonNull nl.vpro.domain.media.support.OwnerType owner, @NonNull TextualType type) Creates a newTitle
with a length of 256 characters.Title
(@NonNull String title, @NonNull nl.vpro.domain.media.support.OwnerType owner, @NonNull TextualType type, boolean crop) Optional constructor to bypass cropping the title to a length of 256 characters which is the default.Title
(Title source, MediaObject parent) -
Method Summary
Modifier and TypeMethodDescriptionstatic Title
static Title
copy
(Title source, MediaObject parent) void
crop()
void
crop
(int stop) void
crop
(int start, int stop) boolean
get()
getId()
int
hashCode()
static Title
static Title
boolean
void
void
setParent
(MediaObject parent) static Title
shortTitle
(String main) static Title
shortTitle
(String main, nl.vpro.domain.media.support.OwnerType type) protected static String
static Title
Methods inherited from class nl.vpro.domain.AbstractOwnedText
getOwner, getType, setOwner, setType, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty
Methods inherited from interface nl.vpro.domain.OwnedText
compareTo, fullString
Methods inherited from interface nl.vpro.domain.TypedText
charAt, length, subSequence
-
Field Details
-
value
@NotNull(message="{nl.vpro.constraints.NotNull}") @Size(min=1,message="{nl.vpro.constraints.text.Size.min}") @Size(max=255,message="{nl.vpro.constraints.text.Size.max}") @NoHtml protected @NotNull(message="{nl.vpro.constraints.NotNull}") @Size(min=1,message="{nl.vpro.constraints.text.Size.min}") @Size(max=255,message="{nl.vpro.constraints.text.Size.max}") @NoHtml String value -
parent
-
-
Constructor Details
-
Title
public Title(@NonNull String title, @NonNull nl.vpro.domain.media.support.OwnerType owner, @NonNull TextualType type) Creates a newTitle
with a length of 256 characters. -
Title
public Title(@NonNull String title, @NonNull nl.vpro.domain.media.support.OwnerType owner, @NonNull TextualType type, boolean crop) Optional constructor to bypass cropping the title to a length of 256 characters which is the default. -
Title
-
Title
-
Title
public Title()
-
-
Method Details
-
copy
-
copy
-
main
-
main
-
sub
-
shortTitle
-
shortTitle
-
crop
public void crop() -
crop
public void crop(int stop) -
crop
public void crop(int start, int stop) -
getId
- Specified by:
getId
in interfaceIdentifiable<Long>
-
get
-
set
-
strip
-
getParent
- Specified by:
getParent
in interfaceChild<MediaObject>
-
setParent
- Specified by:
setParent
in interfaceChild<MediaObject>
-
equals
- Overrides:
equals
in classAbstractOwnedText<Title>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractOwnedText<Title>
-
mayContainNewLines
public boolean mayContainNewLines()- Specified by:
mayContainNewLines
in interfaceTypedText
-