public void updateUser(User user) {
        Assert.isTrue(userId.equals(user.getId()), "User ID of command must match the user being updated.");
        user.setUsername(getUsername());
        user.setEmail(getEmail());
        if (StringUtils.hasText(getPassword())) {
            user.setPassword(new Sha256Hash(getPassword()).toHex());
        }
    }
Command binding object for editing a user.
samples/spring-hibernate/src/main/java/org/apache/shiro/samples/sprhib/web/EditUserCommand.java