package jsonfeed4j;

import java.util.Collections;
import java.util.Map;
import java.util.Optional;

import javax.activation.MimeType;

public class Attachment {

  private String url;
  private MimeType mimeType;
  private String title;
  private Long sizeInBytes;
  private Long durationInSeconds;
  private Map<String, Object> extensions = Collections.emptyMap();
  
  public String getUrl() {
    return url;
  }
  
  public MimeType getMimeType() {
    return mimeType;
  }
  
  public Optional<String> getTitle() {
    return Optional.ofNullable(title);
  }
  
  public Optional<Long> getSizeInBytes() {
    return Optional.ofNullable(sizeInBytes);
  }
  
  public Optional<Long> getDurationInSeconds() {
    return Optional.ofNullable(durationInSeconds);
  }
  
  public Extensions getExtensions() {
    return new Extensions(extensions);
  }
}

@@ -127,16 +127,107 @@
 imeType;
+%0Aimport javax.validation.constraints.NotNull;%0A%0Aimport jsonfeed4j.validation.RequiredString;
 %0A%0Apublic
@@ -247,16 +247,34 @@
 ment %7B%0A%0A
+  @RequiredString%0A
   privat
@@ -287,16 +287,27 @@
 ng url;%0A
+  @NotNull%0A
   privat

Add validation to Attachment