Skip to content

Commit

Permalink
Fix Checkstyle (javadoc)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-ronge committed Aug 16, 2024
1 parent 722148f commit 252cb75
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.
*/
Expand Down Expand Up @@ -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<Metadata> getMetadata() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

package org.kitodo.production.interfaces.activemq;

import edu.umd.cs.findbugs.annotations.CheckForNull;

import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
Expand All @@ -28,8 +30,6 @@
import org.apache.logging.log4j.Logger;
import org.kitodo.utils.Guard;

import edu.umd.cs.findbugs.annotations.CheckForNull;

public class MapMessageObjectReader {

private MapMessage ticket;
Expand Down Expand Up @@ -252,6 +252,19 @@ public Map<String, String> 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);
Expand All @@ -264,6 +277,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);
Expand All @@ -276,6 +302,20 @@ public Integer getInteger(String key) throws JMSException {
return (Integer) valueObject;
}

/**
* Fetches a {@code Map<String, ?>} 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<String, ?> getMapOfString(String key) throws JMSException {
HashMap<String, Object> mapOfString = new HashMap<>();
Expand Down

0 comments on commit 252cb75

Please sign in to comment.