Skip to content

Commit

Permalink
comment:(review) modified comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sttk committed Sep 28, 2023
1 parent 91ba5f9 commit 4a6c40a
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 35 deletions.
12 changes: 6 additions & 6 deletions src/main/java/com/github/sttk/sabi/Dax.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
import com.github.sttk.sabi.errs.Err;

/**
* Dax is the interface for a set of data access methods.
* {@code Dax} is the interface for a set of data access methods.
*
* This interface is inherited by Dax implementations for data stores, and
* each Dax implementation defines data access methods to each data store.
* This interface is inherited by dax implementations for data stores, and
* each dax implementation defines data access methods to each data store.
* In data access methods, {@link DaxConn} instances conected to data stores
* can be obtained with {@link #getDaxConn} method.
*/
public interface Dax {

/**
* Gets a DaxConn instance associated with the argument name.
* The name is same as what was registered with DaxSrc using {@link
* Sabi#uses} method.
* Gets a {@link DaxConn} instance associated with the argument name.
* The name is same as what was registered with {@link DaxSrc} using
* {@link Sabi#uses} method.
*
* @param <C> The type of a {@link DaxConn}.
* @param name A name of a {@link DaxConn}.
Expand Down
29 changes: 15 additions & 14 deletions src/main/java/com/github/sttk/sabi/DaxBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
import com.github.sttk.sabi.async.AsyncGroupSync;

/**
* DaxBase is the class that defines the methods to manage {@link DaxSrc}(s).
* {@code DaxBase} is the class that defines the methods to manage
* {@link DaxSrc}(s).
* And this class defines private methods to process a transaction.
*/
public class DaxBase implements Dax, AutoCloseable {
/**
* FailToSetupGlobalDaxSrcs is the error reason which indicates that some
* DaxSrc(s) failed to set up.
* {@code FailToSetupGlobalDaxSrcs} is the error reason which indicates that
* some {@link DaxSrc}(s) failed to set up.
*
* @param errors The map holding keys that are the registered names of
* {@link DaxSrc}(s) failed, and values that are {@link Err}(s) having
Expand All @@ -30,32 +31,32 @@ public class DaxBase implements Dax, AutoCloseable {
public record FailToSetupGlobalDaxSrcs(Map<String, Err> errors) {};

/**
* FailToSetupLocalDaxSrc is the error reason which indicates a local
* {@code FailToSetupLocalDaxSrc} is the error reason which indicates a local
* {@link DaxSrc} failed to set up.
*
* @param name Tthe registered name of the {@link DaxSrc} failed.
*/
public record FailToSetupLocalDaxSrc(String name) {};

/**
* DaxSrcIsNotFound is the error reason which indicates that a specified
* {@link DaxSrc} is not found.
* {@code DaxSrcIsNotFound} is the error reason which indicates that a
* specified {@link DaxSrc} is not found.
*
* @param name The registered name of the {@link DaxSrc} not found.
*/
public record DaxSrcIsNotFound(String name) {}

/**
* FailToCreateDaxConn is the error reason which indicates that it is failed
* to create a new connection to a data store.
* {@code FailToCreateDaxConn} is the error reason which indicates that it is
* failed to create a new connection to a data store.
*
* @param name The registered name of the {@link DaxSrc} failed to create a
* {@link DaxConn}.
*/
public record FailToCreateDaxConn(String name) {}

/**
* FailToCommitDaxConn is the error reason which indicates that some
* {@code FailToCommitDaxConn} is the error reason which indicates that some
* connections failed to commit.
*
* @param errors The map holding keys that are the names of
Expand All @@ -65,7 +66,7 @@ public record FailToCreateDaxConn(String name) {}
public record FailToCommitDaxConn(Map<String, Err> errors) {}

/**
* CreatedDaxConnIsNull is the error reason which indicates that a
* {@code CreatedDaxConnIsNull} is the error reason which indicates that a
* {@link DaxSrc} created a {@link DaxConn} interface but it is null.
*
* @param name The name of the {@link DaxSrc} that try to create a
Expand All @@ -74,8 +75,8 @@ public record FailToCommitDaxConn(Map<String, Err> errors) {}
public record CreatedDaxConnIsNull(String name) {}

/**
* FailToRunLogic is the error reason which indicates that a logic failed
* to run.
* {@code FailToRunLogic} is the error reason which indicates that a logic
* failed to run.
*
* @param logic The logic class name failed.
*/
Expand All @@ -84,7 +85,7 @@ public record FailToRunLogic(String logic) {}
/** The flag to prevent further registration of global {@link DaxSrc}(s). */
private static boolean isGlobalDaxSrcsFixed;

/** The map for registering global DaxSrc instances. */
/** The map for registering global {@link DaxSrc} instances. */
private static final Map<String, DaxSrc> globalDaxSrcMap;

static {
Expand All @@ -93,7 +94,7 @@ public record FailToRunLogic(String logic) {}

/**
* Registers to enable data accesses to data store associated with the
* argument DaxSrc in all Dax instances.
* argument {@link DaxSrc} in all dax instances.
*/
static void addGlobalDaxSrc(String name, DaxSrc ds) {
if (isGlobalDaxSrcsFixed) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/github/sttk/sabi/DaxConn.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.github.sttk.sabi.errs.Err;

/**
* DaxConn is the interface that represents a connection to a data store.
* {@code DaxConn} is the interface that represents a connection to a data store.
* This interface declares methods: {@link #commit}, {@link rollback} and
* {@link #close} to
* work in a transaction
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/github/sttk/sabi/DaxSrc.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import com.github.sttk.sabi.errs.Err;

/**
* DaxSrc is the interface that represents a data source like database, etc.,
* and creates a {@link DaxConn} which is a connection to the data source.
* {@code DaxSrc} is the interface that represents a data source like database,
* etc.,and creates a {@link DaxConn} which is a connection to the data source.
* This interface declares three methods: {@link #setup}, {@link #close}, and
* {@link #createDaxConn}.
*
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/github/sttk/sabi/Logic.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.github.sttk.sabi.errs.Err;

/**
* Logic is the functional interface that represents a logical procedure.
* {@code Logic} is the functional interface that represents a logical procedure.
* The {@link #run} method of the class inheriting this interface implements
* only logic processing.
* Data access processing is described only by calling methods of the argument
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/github/sttk/sabi/Para.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import java.util.concurrent.ExecutionException;

/**
* Para is a class to runs {@link Runner}(s) in parallel.
* {@code Para} is a class to runs {@link Runner}(s) in parallel.
*/
public class Para implements Runner {

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/github/sttk/sabi/Runner.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.github.sttk.sabi.errs.Err;

/**
* Runner is the interface that runs any procedure..
* {@code Runner} is the interface that runs any procedure..
*/
@FunctionalInterface
public interface Runner {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/github/sttk/sabi/Seq.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.github.sttk.sabi.errs.Err;

/**
* Seq is a class to run {@link Runner}(s) sequencially.
* {@code Seq} is a class to run {@link Runner}(s) sequencially.
*/
public class Seq implements Runner {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.HashMap;

/**
* AsyncGroupAsync is the class to run added {@link Runner}(s) on {@link
* {@code AsyncGroupAsync} is the class to run added {@link Runner}(s) on {@link
* AsyncGroup} API asynchronously.
*
* @param <N> The type of a name of a runner or its error.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.github.sttk.sabi.errs.Err;

/**
* AsyncGroupSync is the class to run added {@link Runner}(s) on {@link
* {@code AsyncGroupSync} is the class to run added {@link Runner}(s) on {@link
* AsyncGroup} API but synchronously.
*/
public class AsyncGroupSync implements AsyncGroup {
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/com/github/sttk/sabi/errs/Err.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public final class Err extends Exception {
private static final ErrNotifier notifier = new ErrNotifier();

/**
* A constructor which constructs a new Err instance with a specified reason.
* A constructor which constructs a new {@link Err} instance with a specified
* reason.
* A reason is a structore type of which name expresses what is a reason.
*
* @param reason A reason of this exception.
Expand All @@ -58,8 +59,8 @@ public Err(final Record reason) {
}

/**
* A constructor which constructs a new Err instance with a specified reason
* and an cause.
* A constructor which constructs a new {@link Err} instance with a specified
* reason and an cause.
* A reason is a structore type of which name expresses what is a reason.
*
* @param reason A reason of this exception.
Expand Down Expand Up @@ -135,7 +136,7 @@ public String getMessage() {

/**
* Gets a field value of the reason object by the specified name.
* If the specified named field is not found in the reason of this Err,
* If the specified named field is not found in the reason of this {@link Err},
* this method finds a same named field in reasons of cause exception
* hierarchically.
*
Expand All @@ -160,7 +161,7 @@ public Object get(final String name) {
/**
* Gets a field value of the reason object by the specified {@link Enum}
* name.
* If the specified named field is not found in the reason of this Err,
* If the specified named field is not found in the reason of this {@link Err},
* this method finds a same named field in reasons of cause exception
* hierarchically.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.LinkedList;

/**
* ErrNotifier is the class that notifies {@link Err} creations to {@link
* {@code ErrNotifier} is the class that notifies {@link Err} creations to {@link
* ErrHandler}(s).
* This class manages a list for handlers that process a {@link Err}
* synchronously and another list for handlers that process it asynchronously.
Expand Down

0 comments on commit 4a6c40a

Please sign in to comment.