Skip to content

Commit

Permalink
Javadocs Version enum in Command
Browse files Browse the repository at this point in the history
  • Loading branch information
tinwelint committed Sep 4, 2017
1 parent 8eb8f7a commit b272746
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,15 @@ public static Mode fromRecordState( AbstractBaseRecord record )
}
}

/**
* Many commands have before/after versions of their records. In some scenarios there's a need
* to parameterize which of those to work with.
*/
public enum Version
{
/**
* The "before" version of a command's record. I.e. the record how it looked before changes took place.
*/
BEFORE
{
@Override
Expand All @@ -101,6 +108,9 @@ <RECORD extends AbstractBaseRecord> RECORD select( BaseCommand<RECORD> command )
return command.getBefore();
}
},
/**
* The "after" version of a command's record. I.e. the record how it looks after changes took place.
*/
AFTER
{
@Override
Expand All @@ -110,6 +120,12 @@ <RECORD extends AbstractBaseRecord> RECORD select( BaseCommand<RECORD> command )
}
};

/**
* Selects one of the versions of a {@link BaseCommand}.
*
* @param command command to select a version from.
* @return the specific record version in this command.
*/
abstract <RECORD extends AbstractBaseRecord> RECORD select( BaseCommand<RECORD> command );
}

Expand Down

0 comments on commit b272746

Please sign in to comment.