Sync Adapter to Java 25: add StripePaymentClassAdapter, README mapping

This commit is contained in:
2026-06-24 14:19:36 +05:30
parent 4b6a02f396
commit 8471913dbd
8 changed files with 60 additions and 56 deletions

View File

@@ -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.");