Skip to content

Commit

Permalink
added @nonnull annotations for command sections.
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenag committed Mar 2, 2017
1 parent 0f64c13 commit c0b453b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion community/command-line/pom.xml
Expand Up @@ -50,7 +50,10 @@
<artifactId>neo4j-collections</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>annotations</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
Expand Down
Expand Up @@ -25,6 +25,8 @@
import java.util.Set;
import java.util.function.Consumer;

import javax.annotation.Nonnull;

import org.neo4j.commandline.arguments.Arguments;
import org.neo4j.helpers.Service;
import org.neo4j.helpers.collection.Iterables;
Expand Down Expand Up @@ -84,6 +86,7 @@ public List<Arguments> possibleArguments()
/**
* @return AdminCommandSection the command using the provider is grouped under
*/
@Nonnull
public abstract AdminCommandSection commandSection();

/**
Expand Down
Expand Up @@ -22,11 +22,13 @@
import java.util.Comparator;
import java.util.List;
import java.util.function.Consumer;
import javax.annotation.Nonnull;

public abstract class AdminCommandSection
{
private static final AdminCommandSection GENERAL = new GeneralSection();

@Nonnull
public abstract String printable();

public static AdminCommandSection general()
Expand Down
Expand Up @@ -86,6 +86,6 @@ private Map<AdminCommandSection,List<AdminCommand.Provider>> groupProvidersBySec
{
List<AdminCommand.Provider> providers = new ArrayList<>();
commands.getAllProviders().forEach( providers::add );
return providers.stream().collect( Collectors.groupingBy( ( provider ) -> provider.commandSection() ) );
return providers.stream().collect( Collectors.groupingBy( AdminCommand.Provider::commandSection ) );
}
}

0 comments on commit c0b453b

Please sign in to comment.