From 834c599372276a957511f970336780b2bdbedc46 Mon Sep 17 00:00:00 2001 From: albertattard Date: Sat, 14 Feb 2015 16:50:05 +0000 Subject: [PATCH] --- .../main/java/com/javacreed/examples/mediainfo/MediaInfo.java | 4 ++-- .../main/java/com/javacreed/examples/mediainfo/NameValue.java | 4 ++-- .../main/java/com/javacreed/examples/mediainfo/Section.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/media-info/How to Retrieve the Video Properties/src/main/java/com/javacreed/examples/mediainfo/MediaInfo.java b/media-info/How to Retrieve the Video Properties/src/main/java/com/javacreed/examples/mediainfo/MediaInfo.java index 5547712..124539c 100644 --- a/media-info/How to Retrieve the Video Properties/src/main/java/com/javacreed/examples/mediainfo/MediaInfo.java +++ b/media-info/How to Retrieve the Video Properties/src/main/java/com/javacreed/examples/mediainfo/MediaInfo.java @@ -27,7 +27,7 @@ public class MediaInfo { - public static MediaInfo parse(final String data) { + public static MediaInfo parse(final String data) throws IllegalArgumentException { final MediaInfo mediaInfo = new MediaInfo(data); @@ -57,7 +57,7 @@ private MediaInfo(final String rawData) { this.rawData = Objects.requireNonNull(rawData); } - private Section addSection(final Section section) { + private Section addSection(final Section section) throws IllegalArgumentException { final String name = section.getName(); if (sections.containsKey(name)) { throw new IllegalArgumentException("Duplicate section name: '" + name + "'"); diff --git a/media-info/How to Retrieve the Video Properties/src/main/java/com/javacreed/examples/mediainfo/NameValue.java b/media-info/How to Retrieve the Video Properties/src/main/java/com/javacreed/examples/mediainfo/NameValue.java index aa1b075..46afff0 100644 --- a/media-info/How to Retrieve the Video Properties/src/main/java/com/javacreed/examples/mediainfo/NameValue.java +++ b/media-info/How to Retrieve the Video Properties/src/main/java/com/javacreed/examples/mediainfo/NameValue.java @@ -25,7 +25,7 @@ public class NameValue { - public static NameValue parse(final String line) { + public static NameValue parse(final String line) throws IllegalArgumentException { if (!line.contains(" : ")) { throw new IllegalArgumentException("The line is expected to have a ' : '"); } @@ -37,7 +37,7 @@ public static NameValue parse(final String line) { private final String name; private final String value; - public NameValue(final String name, final String value) { + private NameValue(final String name, final String value) { this.name = Objects.requireNonNull(name); this.value = Objects.requireNonNull(value); } diff --git a/media-info/How to Retrieve the Video Properties/src/main/java/com/javacreed/examples/mediainfo/Section.java b/media-info/How to Retrieve the Video Properties/src/main/java/com/javacreed/examples/mediainfo/Section.java index e6c0bc8..623d398 100644 --- a/media-info/How to Retrieve the Video Properties/src/main/java/com/javacreed/examples/mediainfo/Section.java +++ b/media-info/How to Retrieve the Video Properties/src/main/java/com/javacreed/examples/mediainfo/Section.java @@ -26,7 +26,7 @@ import java.util.Objects; public class Section { - public static Section parse(final String line) { + public static Section parse(final String line) throws IllegalArgumentException { if (line.contains(":")) { throw new IllegalArgumentException("Section name should not have ':'"); } @@ -42,7 +42,7 @@ private Section(final String name) { this.name = Objects.requireNonNull(name); } - public void add(final NameValue nameValue) { + public void add(final NameValue nameValue) throws IllegalArgumentException { final String name = nameValue.getName(); if (values.containsKey(name)) { throw new IllegalArgumentException("Duplicate name: '" + name + "'");