Notification annotations

Report a typo

Imagine you need to set the following constraints for the Notification class:

  • title cannot be empty,
  • content length cannot be longer than 50 symbols,
  • messages list can contain from 1 to 5 messages,
  • textColor can have the next values: "R", "G", "B".

Match the fields and the corresponding annotations:

Java
public class Notification {

    {1}
    private String title;

    {2}
    private String content;
    
    {3}
    private List<Message> messages;

    {4}
    private String textColor;

    // getters and setters
}
Kotlin
class Notification(

    {1}
    var title: String,

    {2}
    var content: String,

    {3}
    var messages: List<Message>,

    {4}
    var textColor: String

)
Match the items from left and right columns
1
2
3
4
@Pattern(regexp = "[RGB]")
@NotEmpty
@Size(min = 1, max = 5)
@Size(max = 50)
___

Create a free account to access the full topic