diff --git a/Kitodo/src/main/java/org/kitodo/production/interfaces/activemq/CreateNewProcessOrder.java b/Kitodo/src/main/java/org/kitodo/production/interfaces/activemq/CreateNewProcessOrder.java index 516c7ecbe0a..558e8621248 100644 --- a/Kitodo/src/main/java/org/kitodo/production/interfaces/activemq/CreateNewProcessOrder.java +++ b/Kitodo/src/main/java/org/kitodo/production/interfaces/activemq/CreateNewProcessOrder.java @@ -11,6 +11,10 @@ package org.kitodo.production.interfaces.activemq; +import edu.umd.cs.findbugs.annotations.CheckForNull; +import edu.umd.cs.findbugs.annotations.NonNull; +import edu.umd.cs.findbugs.annotations.Nullable; + import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -37,10 +41,6 @@ import org.kitodo.production.services.ServiceManager; import org.kitodo.production.services.data.ImportConfigurationService; -import edu.umd.cs.findbugs.annotations.CheckForNull; -import edu.umd.cs.findbugs.annotations.NonNull; -import edu.umd.cs.findbugs.annotations.Nullable; - /** * Order to create a new process. This contains all the necessary data. */ @@ -298,7 +298,7 @@ Process getParent() throws DAOException { * Specifies the metadata for the logical structure root of the process to * be created. Can be empty, but never {@code null}. * - * @return + * @return the metadata */ @NonNull Collection getMetadata() { diff --git a/Kitodo/src/main/java/org/kitodo/production/interfaces/activemq/MapMessageObjectReader.java b/Kitodo/src/main/java/org/kitodo/production/interfaces/activemq/MapMessageObjectReader.java index b5fa1ece007..0d596f7f69b 100644 --- a/Kitodo/src/main/java/org/kitodo/production/interfaces/activemq/MapMessageObjectReader.java +++ b/Kitodo/src/main/java/org/kitodo/production/interfaces/activemq/MapMessageObjectReader.java @@ -300,6 +300,19 @@ public Map getMapOfStringToString(String key) { return mapOfStringToString; } + /** + * Fetches a {@code List} from a MapMessage. May return {@code null} if + * there is no such object. + * + * @param key + * key for which the list to return + * @return the map, or {@code null} + * @throws IllegalArgumentException + * if the object isn’t a {@code List} + * @throws JMSException + * if an I/O exception occurs during read, i.e. if the map + * message sent is larger than the allowed size + */ @CheckForNull public List getList(String key) throws JMSException { Object valueObject = ticket.getObject(key); @@ -312,6 +325,19 @@ public List getList(String key) throws JMSException { return (List) valueObject; } + /** + * Fetches an {@code Integer} from a MapMessage. May return {@code null} if + * there is no such object. + * + * @param key + * key for which the integer to return + * @return the integer, or {@code null} if there isn’t one + * @throws IllegalArgumentException + * if the object is not an Integer + * @throws JMSException + * if an I/O exception occurs during read, i.e. if the map + * message sent is larger than the allowed size + */ @CheckForNull public Integer getInteger(String key) throws JMSException { Object valueObject = ticket.getObject(key); @@ -324,6 +350,20 @@ public Integer getInteger(String key) throws JMSException { return (Integer) valueObject; } + /** + * Fetches a {@code Map} from a MapMessage. May return + * {@code null} if there is no such object. + * + * @param key + * key for which the map to return + * @return the map, or {@code null} + * @throws IllegalArgumentException + * if the object isn’t a {@code Map} or one of its keys isn’t a + * {@code String} + * @throws JMSException + * if an I/O exception occurs during read, i.e. if the map + * message sent is larger than the allowed size + */ @CheckForNull public Map getMapOfString(String key) throws JMSException { HashMap mapOfString = new HashMap<>();