@Test public void testSanityCheck() { assertTrue("Media package must pass check", sanityCheck(loadFromClassPath("/manifest.xml")).isNone()); assertTrue("There must be errors", sanityCheck(loadFromClassPath("/manifest-insane.xml")).isSome()); }
public static Option<List<String>> sanityCheck(MediaPackage mp) { final Option<List<String>> errors = sequenceOpt(list(toOption(mp.getIdentifier() != null, "no ID"), toOption(mp.getIdentifier() != null && isNotBlank(mp.getIdentifier().toString()), "blank ID"))); return errors.getOrElse(NIL).size() == 0 ? Option.<List<String>> none() : errors; }
MediaPackageSupport { public static Option<List<String>> sanityCheck(MediaPackage mp) { final Option<List<String>> errors = sequenceOpt(list(toOption(mp.getIdentifier() != null, "no ID"), toOption(mp.getIdentifier() != null && isNotBlank(mp.getIdentifier().toString()), "blank ID"))); return errors.getOrElse(NIL).size() == 0 ? Option.<List<String>> none() : errors; } }
MediaPackageSupport { public static Option<List<String>> sanityCheck(MediaPackage mp) { final Option<List<String>> errors = sequenceOpt(list(toOption(mp.getIdentifier() != null, "no ID"), toOption(mp.getIdentifier() != null && isNotBlank(mp.getIdentifier().toString()), "blank ID"))); return errors.getOrElse(NIL).size() == 0 ? Option.<List<String>> none() : errors; } private  MediaPackageSupport(); }
MediaPackageSupport { public static Option<List<String>> sanityCheck(MediaPackage mp) { final Option<List<String>> errors = sequenceOpt(list(toOption(mp.getIdentifier() != null, "no ID"), toOption(mp.getIdentifier() != null && isNotBlank(mp.getIdentifier().toString()), "blank ID"))); return errors.getOrElse(NIL).size() == 0 ? Option.<List<String>> none() : errors; } private  MediaPackageSupport(); static MediaPackage merge(MediaPackage dest, MediaPackage src, MergeMode mode); static boolean contains(String identifier, MediaPackage mp); static Opt<String> getFileName(MediaPackageElement mpe); static MediaPackage copy(MediaPackage mp); static void updateElement(MediaPackage mp, MediaPackageElement e); static Effect<MediaPackageElement> updateElement(final MediaPackage mp); static Option<List<String>> sanityCheck(MediaPackage mp); static MediaPackage loadFromClassPath(String path); static boolean isPublishable(MediaPackage mp); }
MediaPackageSupport { public static Option<List<String>> sanityCheck(MediaPackage mp) { final Option<List<String>> errors = sequenceOpt(list(toOption(mp.getIdentifier() != null, "no ID"), toOption(mp.getIdentifier() != null && isNotBlank(mp.getIdentifier().toString()), "blank ID"))); return errors.getOrElse(NIL).size() == 0 ? Option.<List<String>> none() : errors; } private  MediaPackageSupport(); static MediaPackage merge(MediaPackage dest, MediaPackage src, MergeMode mode); static boolean contains(String identifier, MediaPackage mp); static Opt<String> getFileName(MediaPackageElement mpe); static MediaPackage copy(MediaPackage mp); static void updateElement(MediaPackage mp, MediaPackageElement e); static Effect<MediaPackageElement> updateElement(final MediaPackage mp); static Option<List<String>> sanityCheck(MediaPackage mp); static MediaPackage loadFromClassPath(String path); static boolean isPublishable(MediaPackage mp); static final Function<MediaPackageElement, String> getMediaPackageElementId; @Deprecated
  static final Function<MediaPackage, String> getId; }