Class Kijkwijzer
- java.lang.Object
-
- nl.vpro.nicam.Kijkwijzer
-
- All Implemented Interfaces:
Serializable
,NicamRated
public class Kijkwijzer extends Object implements NicamRated, Serializable
See about kijkwijzer
Combines an
AgeRating
withContentRating
s (which can be seen as the 'reason' for the rating).There are several ways to code a kijkwijzer in a string.
For the content ratings, this is pretty straight forward. Every rating is assigned a simple
ContentRating.toChar()
. A string of those chars represents the content ratings.Age ratings are represented in different ways, but always as an integer. Prior to 5.12 it was always one digit. See
toDonnaCode()
andtoCode()
With the arrival of new age ratings
AgeRating._14
andAgeRating._18
it was unclear what the new digits would be for those, and we decided to simply introduce a new format where the age rating is always represented with two digits, and where the correspondence is more straightforward (the integer associated with e.g.AgeRating._14
became14
) (usingtoPaddedCode(AgeRating)
- Since:
- 4.2
- Author:
- Michiel Meeuwissen
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Kijkwijzer()
Kijkwijzer(@Nullable AgeRating ageRating, @NonNull ContentRating... contentRatings)
Kijkwijzer(@Nullable AgeRating ageRating, Collection<@NonNull ContentRating> contentRatings)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected boolean
canEqual(@Nullable Object other)
boolean
equals(@Nullable Object o)
AgeRating
getAgeRating()
List<@NonNull ContentRating>
getContentRatings()
int
hashCode()
static Kijkwijzer
of(NicamRated nicamRated)
static Kijkwijzer
parse(String value)
Deprecated.static Kijkwijzer
parseDonna(String value)
Deprecated.static Optional<Kijkwijzer>
parsePaddedCode(CharSequence value)
String
toCode()
Deprecated.static @Nullable Character
toCode(@Nullable AgeRating ageRating)
Deprecated.String
toDonnaCode()
Deprecated.static @Nullable Character
toDonnaCode(@Nullable AgeRating ageRating)
String
toPaddedCode()
A short string representing this NICAM rating, a 2 digit integertoPaddedCode(AgeRating)
followed by theContentRating.toChar()
s of the content ratings.static String
toPaddedCode(@Nullable AgeRating ageRating)
Returns the age rating as a padded int, always 2 chars.@NonNull String
toString()
Kijkwijzer
withAgeRating(AgeRating ageRating)
Kijkwijzer
withContentRating(ContentRating... contentRating)
Kijkwijzer
withContentRatings(List<ContentRating> contentRatings)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface nl.vpro.nicam.NicamRated
isNicamRated
-
-
-
-
Constructor Detail
-
Kijkwijzer
public Kijkwijzer(@Nullable AgeRating ageRating, Collection<@NonNull ContentRating> contentRatings)
-
Kijkwijzer
public Kijkwijzer(@Nullable AgeRating ageRating, @NonNull ContentRating... contentRatings)
-
Kijkwijzer
public Kijkwijzer()
-
-
Method Detail
-
parse
@Deprecated public static Kijkwijzer parse(String value)
Deprecated.
-
parseDonna
@Deprecated public static Kijkwijzer parseDonna(String value)
Deprecated.
-
parsePaddedCode
public static Optional<Kijkwijzer> parsePaddedCode(CharSequence value)
- Since:
- 5.12
-
toCode
@Deprecated public static @Nullable Character toCode(@Nullable AgeRating ageRating)
Deprecated.
-
toPaddedCode
public static String toPaddedCode(@Nullable AgeRating ageRating)
Returns the age rating as a padded int, always 2 chars.- Returns:
- the agerating as a padded int, or the empty string if the given age rating is
null
-
of
public static Kijkwijzer of(NicamRated nicamRated)
-
withAgeRating
public Kijkwijzer withAgeRating(AgeRating ageRating)
-
withContentRating
public Kijkwijzer withContentRating(ContentRating... contentRating)
-
withContentRatings
public Kijkwijzer withContentRatings(List<ContentRating> contentRatings)
-
toDonnaCode
@Deprecated public String toDonnaCode()
Deprecated.
-
toCode
@Deprecated public String toCode()
Deprecated.
-
toPaddedCode
public String toPaddedCode()
A short string representing this NICAM rating, a 2 digit integertoPaddedCode(AgeRating)
followed by theContentRating.toChar()
s of the content ratings.- Since:
- 5.12
-
getAgeRating
public AgeRating getAgeRating()
- Specified by:
getAgeRating
in interfaceNicamRated
-
getContentRatings
public List<@NonNull ContentRating> getContentRatings()
- Specified by:
getContentRatings
in interfaceNicamRated
-
canEqual
protected boolean canEqual(@Nullable Object other)
-
-