Resolves checkstyle errors for remaining m (#1090)
* Reduces checkstyle errors in marker * Reduces checkstyle errors in master-worker-pattern * Reduces checkstyle errors in mediator * Reduces checkstyle errors in memento * Reduces checkstyle errors in model-view-controller * Reduces checkstyle errors in model-view-presenter * Reduces checkstyle errors in module * Reduces checkstyle errors in monad * Reduces checkstyle errors in monostate * Reduces checkstyle errors in multiton * Reduces checkstyle errors in mute-idiom * Reduces checkstyle errors in mutex
This commit is contained in:
committed by
Ilkka Seppälä
parent
3ccc9baa1a
commit
1fdc650545
@ -24,15 +24,15 @@
|
||||
package com.iluwatar.mediator;
|
||||
|
||||
/**
|
||||
*
|
||||
* Action enumeration.
|
||||
*
|
||||
*/
|
||||
public enum Action {
|
||||
|
||||
HUNT("hunted a rabbit", "arrives for dinner"), TALE("tells a tale", "comes to listen"), GOLD(
|
||||
"found gold", "takes his share of the gold"), ENEMY("spotted enemies", "runs for cover"), NONE(
|
||||
"", "");
|
||||
HUNT("hunted a rabbit", "arrives for dinner"),
|
||||
TALE("tells a tale", "comes to listen"),
|
||||
GOLD("found gold", "takes his share of the gold"),
|
||||
ENEMY("spotted enemies", "runs for cover"),
|
||||
NONE("", "");
|
||||
|
||||
private String title;
|
||||
private String description;
|
||||
|
@ -24,32 +24,31 @@
|
||||
package com.iluwatar.mediator;
|
||||
|
||||
/**
|
||||
*
|
||||
* The Mediator pattern defines an object that encapsulates how a set of objects interact. This
|
||||
* pattern is considered to be a behavioral pattern due to the way it can alter the program's
|
||||
* running behavior.
|
||||
* <p>
|
||||
* Usually a program is made up of a large number of classes. So the logic and computation is
|
||||
*
|
||||
* <p>Usually a program is made up of a large number of classes. So the logic and computation is
|
||||
* distributed among these classes. However, as more classes are developed in a program, especially
|
||||
* during maintenance and/or refactoring, the problem of communication between these classes may
|
||||
* become more complex. This makes the program harder to read and maintain. Furthermore, it can
|
||||
* become difficult to change the program, since any change may affect code in several other
|
||||
* classes.
|
||||
* <p>
|
||||
* With the Mediator pattern, communication between objects is encapsulated with a mediator object.
|
||||
* Objects no longer communicate directly with each other, but instead communicate through the
|
||||
* mediator. This reduces the dependencies between communicating objects, thereby lowering the
|
||||
*
|
||||
* <p>With the Mediator pattern, communication between objects is encapsulated with a mediator
|
||||
* object. Objects no longer communicate directly with each other, but instead communicate through
|
||||
* the mediator. This reduces the dependencies between communicating objects, thereby lowering the
|
||||
* coupling.
|
||||
* <p>
|
||||
* In this example the mediator encapsulates how a set of objects ({@link PartyMember}) interact.
|
||||
* Instead of referring to each other directly they use the mediator ({@link Party}) interface.
|
||||
*
|
||||
*
|
||||
* <p>In this example the mediator encapsulates how a set of objects ({@link PartyMember})
|
||||
* interact. Instead of referring to each other directly they use the mediator ({@link Party})
|
||||
* interface.
|
||||
*/
|
||||
public class App {
|
||||
|
||||
/**
|
||||
* Program entry point
|
||||
*
|
||||
* Program entry point.
|
||||
*
|
||||
* @param args command line args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
|
@ -24,9 +24,7 @@
|
||||
package com.iluwatar.mediator;
|
||||
|
||||
/**
|
||||
*
|
||||
* Hobbit party member.
|
||||
*
|
||||
*/
|
||||
public class Hobbit extends PartyMemberBase {
|
||||
|
||||
|
@ -24,9 +24,7 @@
|
||||
package com.iluwatar.mediator;
|
||||
|
||||
/**
|
||||
*
|
||||
* Hunter party member.
|
||||
*
|
||||
*/
|
||||
public class Hunter extends PartyMemberBase {
|
||||
|
||||
|
@ -24,9 +24,7 @@
|
||||
package com.iluwatar.mediator;
|
||||
|
||||
/**
|
||||
*
|
||||
* Party interface.
|
||||
*
|
||||
*/
|
||||
public interface Party {
|
||||
|
||||
|
@ -27,9 +27,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* Party implementation.
|
||||
*
|
||||
*/
|
||||
public class PartyImpl implements Party {
|
||||
|
||||
|
@ -24,9 +24,7 @@
|
||||
package com.iluwatar.mediator;
|
||||
|
||||
/**
|
||||
*
|
||||
* Interface for party members interacting with {@link Party}.
|
||||
*
|
||||
*/
|
||||
public interface PartyMember {
|
||||
|
||||
|
@ -27,9 +27,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* Abstract base class for party members.
|
||||
*
|
||||
*/
|
||||
public abstract class PartyMemberBase implements PartyMember {
|
||||
|
||||
|
@ -24,9 +24,7 @@
|
||||
package com.iluwatar.mediator;
|
||||
|
||||
/**
|
||||
*
|
||||
* Rogue party member.
|
||||
*
|
||||
*/
|
||||
public class Rogue extends PartyMemberBase {
|
||||
|
||||
|
@ -24,9 +24,7 @@
|
||||
package com.iluwatar.mediator;
|
||||
|
||||
/**
|
||||
*
|
||||
* Wizard party member.
|
||||
*
|
||||
*/
|
||||
public class Wizard extends PartyMemberBase {
|
||||
|
||||
|
Reference in New Issue
Block a user