mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-18 11:25:50 +00:00
deps: Refactor dependencies (#3224)
* remove spring dep move junit, logging, mockito under dep mgmt * upgrade anti-corruption-layer deps * async method invocation * balking, bloc * bridge to bytecode * caching * callback - cqrs * component - health check * hexagonal - metadata mapping * rest of the patterns * remove checkstyle, take spotless into use
This commit is contained in:
@@ -27,17 +27,18 @@ package com.iluwatar.subclasssandbox;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* The subclass sandbox pattern describes a basic idea, while not having a lot
|
||||
* of detailed mechanics. You will need the pattern when you have several similar
|
||||
* subclasses. If you have to make a tiny change, then change the base class,
|
||||
* while all subclasses shouldn't have to be touched. So the base class has to be
|
||||
* able to provide all the operations a derived class needs to perform.
|
||||
* The subclass sandbox pattern describes a basic idea, while not having a lot of detailed
|
||||
* mechanics. You will need the pattern when you have several similar subclasses. If you have to
|
||||
* make a tiny change, then change the base class, while all subclasses shouldn't have to be
|
||||
* touched. So the base class has to be able to provide all the operations a derived class needs to
|
||||
* perform.
|
||||
*/
|
||||
@Slf4j
|
||||
public class App {
|
||||
|
||||
/**
|
||||
* Entry point of the main program.
|
||||
*
|
||||
* @param args Program runtime arguments.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
@@ -48,5 +49,4 @@ public class App {
|
||||
var groundDive = new GroundDive();
|
||||
groundDive.activate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,9 +26,7 @@ package com.iluwatar.subclasssandbox;
|
||||
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* GroundDive superpower.
|
||||
*/
|
||||
/** GroundDive superpower. */
|
||||
public class GroundDive extends Superpower {
|
||||
|
||||
public GroundDive() {
|
||||
|
||||
@@ -26,9 +26,7 @@ package com.iluwatar.subclasssandbox;
|
||||
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* SkyLaunch superpower.
|
||||
*/
|
||||
/** SkyLaunch superpower. */
|
||||
public class SkyLaunch extends Superpower {
|
||||
|
||||
public SkyLaunch() {
|
||||
|
||||
@@ -27,21 +27,22 @@ package com.iluwatar.subclasssandbox;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
/**
|
||||
* Superpower abstract class. In this class the basic operations of all types of
|
||||
* superpowers are provided as protected methods.
|
||||
* Superpower abstract class. In this class the basic operations of all types of superpowers are
|
||||
* provided as protected methods.
|
||||
*/
|
||||
public abstract class Superpower {
|
||||
|
||||
protected Logger logger;
|
||||
|
||||
/**
|
||||
* Subclass of superpower should implement this sandbox method by calling the
|
||||
* methods provided in this super class.
|
||||
* Subclass of superpower should implement this sandbox method by calling the methods provided in
|
||||
* this super class.
|
||||
*/
|
||||
protected abstract void activate();
|
||||
|
||||
/**
|
||||
* Move to (x, y, z).
|
||||
*
|
||||
* @param x X coordinate.
|
||||
* @param y Y coordinate.
|
||||
* @param z Z coordinate.
|
||||
@@ -52,6 +53,7 @@ public abstract class Superpower {
|
||||
|
||||
/**
|
||||
* Play sound effect for the superpower.
|
||||
*
|
||||
* @param soundName Sound name.
|
||||
* @param volume Value of volume.
|
||||
*/
|
||||
@@ -61,6 +63,7 @@ public abstract class Superpower {
|
||||
|
||||
/**
|
||||
* Spawn particles for the superpower.
|
||||
*
|
||||
* @param particleType Particle type.
|
||||
* @param count Count of particles to be spawned.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user