Skip to content

Commit

Permalink
Rename classes to Outline* convention
Browse files Browse the repository at this point in the history
  • Loading branch information
sangupta committed Sep 2, 2016
1 parent f2c560c commit 5af7be7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/sangupta/outline/Outline.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import java.util.Map;
import java.util.Set;

import com.sangupta.outline.cmdfactory.CommandFactory;
import com.sangupta.outline.cmdfactory.DefaultCommandFactory;
import com.sangupta.outline.cmdfactory.OutlineCommandFactory;
import com.sangupta.outline.cmdfactory.OutlineDefaultCommandFactory;

/**
* Entry class for building the outlines of command line tools.
Expand All @@ -40,7 +40,7 @@ public class Outline extends OutlineBase {

String helpKeyword = "help";

CommandFactory commandFactory = new DefaultCommandFactory();
OutlineCommandFactory commandFactory = new OutlineDefaultCommandFactory();

final Map<String, OutlineBase> groups = new HashMap<>();

Expand Down Expand Up @@ -146,7 +146,7 @@ public Outline withHelpKeyword(String word) {
return this;
}

public Outline withCommandFactory(CommandFactory commandFactory) {
public Outline withCommandFactory(OutlineCommandFactory commandFactory) {
this.commandFactory = commandFactory;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

package com.sangupta.outline.cmdfactory;

public interface CommandFactory {
public interface OutlineCommandFactory {

public <T> T createInstance(Class<T> instanceClass);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@

package com.sangupta.outline.cmdfactory;

public class DefaultCommandFactory implements CommandFactory {
/**
* Default implementation for the {@link OutlineCommandFactory} that uses reflection
* to construct an instance using a no-param default constructor.
*
* @author sangupta
*
*/
public class OutlineDefaultCommandFactory implements OutlineCommandFactory {

@Override
public <T> T createInstance(Class<T> instanceClass) {
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/sangupta/outline/OutlineTestSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import com.sangupta.outline.annotations.Command;
import com.sangupta.outline.annotations.Option;
import com.sangupta.outline.annotations.OptionType;
import com.sangupta.outline.cmdfactory.DefaultCommandFactory;
import com.sangupta.outline.cmdfactory.OutlineDefaultCommandFactory;

public class OutlineTestSupport {

Expand All @@ -36,7 +36,7 @@ public static Outline getOutline() {
.withDescription("the powerful SCM tool")
.withDefaultCommand(AddCommand.class)
.withHelpKeyword("help")
.withCommandFactory(new DefaultCommandFactory())
.withCommandFactory(new OutlineDefaultCommandFactory())
.withCommands(AddCommand.class, ResetCommand.class)
.withCommands(RemoteAddCommand.class, RemoteRemoveCommand.class)
.withCommands(AllOptionCommand.class)
Expand Down

0 comments on commit 5af7be7

Please sign in to comment.