Skip to content

Commit

Permalink
GH-305 - Polishing.
Browse files Browse the repository at this point in the history
Mostly Javadoc.
  • Loading branch information
odrotbohm committed Sep 26, 2023
1 parent 3208009 commit 1127632
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
13 changes: 12 additions & 1 deletion src/main/java/org/salespointframework/useraccount/Password.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public abstract class Password {
*/
abstract String asString();

/**
* An encrypted password.
*
* @author Oliver Drotbohm
*/
@Embeddable
@EqualsAndHashCode(callSuper = false)
@RequiredArgsConstructor(staticName = "of", access = AccessLevel.PACKAGE)
Expand Down Expand Up @@ -87,14 +92,20 @@ private UnencryptedPassword(String password) {
this.value = password;
}

/**
* Creates a new unencrypted password.
*
* @param password must not be {@literal null} or empty.
* @return will never be {@literal null}.
*/
public static UnencryptedPassword of(String password) {
return new UnencryptedPassword(password);
}

/**
* Returns the length of the password.
*
* @return
* @return a positive integer.
*/
public int getLength() {
return value.length();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public final class Role implements Serializable, Comparable<Role>, ValueObject {
* Creates a new {@link Role} instance with the given name.
*
* @param name the name of the Role, must not be {@literal null} or empty.
* @return will never be {@literal null}.
*/
public static Role of(String name) {
return new Role(name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,36 +118,36 @@ public interface UserAccountManagement {
* Checks if an {@link UserAccount} exists.
*
* @param userAccountIdentifier
* @return
* @return whether a {@link UserAccount} with the given identifier exists.
*/
boolean contains(UserAccountIdentifier userAccountIdentifier);

/**
* Finds all {@link UserAccount}s.
*
* @return
* @return will never be {@literal null}.
*/
Streamable<UserAccount> findAll();

/**
* Finds only enabled {@link UserAccount}s.
*
* @return
* @return will never be {@literal null}.
*/
Streamable<UserAccount> findEnabled();

/**
* Finds only disabled {@link UserAccount}s.
*
* @return
* @return will never be {@literal null}.
*/
Streamable<UserAccount> findDisabled();

/**
* Returns the user with the given user name.
*
* @param username must not be {@literal null} or empty.
* @return
* @return will never be {@literal null}.
*/
Optional<UserAccount> findByUsername(String username);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@ interface UserAccountRepository
/**
* Returns all enabled {@link UserAccount}s.
*
* @return
* @return will never be {@literal null}.
*/
Streamable<UserAccount> findByEnabledTrue();

/**
* Returns all disabled {@link UserAccount}s.
*
* @return
* @return will never be {@literal null}.
*/
Streamable<UserAccount> findByEnabledFalse();

/**
* Returns the {@link UserAccount} with the given email address.
*
* @param emailAddress must not be {@literal null}.
* @return
* @return will never be {@literal null}.
* @since 7.1
*/
Optional<UserAccount> findByEmail(String emailAddress);
Expand Down

0 comments on commit 1127632

Please sign in to comment.