Sync Adapter to Java 25: add StripePaymentClassAdapter, README mapping
This commit is contained in:
@@ -1,14 +1,5 @@
|
||||
package adapter;
|
||||
|
||||
/**
|
||||
* Adapter Design Pattern — Runnable Demo
|
||||
*
|
||||
* Demonstrates wrapping an incompatible StripeClient behind
|
||||
* the PaymentGateway interface your application expects.
|
||||
*
|
||||
* Run: javac adapter/*.java && java adapter.Main
|
||||
* Article: https://ankurm.com/adapter-design-pattern-java/
|
||||
*/
|
||||
public class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
@@ -28,8 +19,6 @@ public class Main {
|
||||
|
||||
// --- JDK Example: InputStreamReader as Adapter ---
|
||||
System.out.println("\n-- JDK Adapter: InputStreamReader --");
|
||||
// InputStreamReader adapts InputStream (byte-based) to Reader (char-based)
|
||||
// The client (BufferedReader) only knows about Reader, not InputStream
|
||||
System.out.println("InputStreamReader wraps System.in (InputStream) as a Reader.");
|
||||
System.out.println("Your code reads chars; the adapter handles byte-to-char conversion.");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user