This is an automated email from the ASF dual-hosted git repository.

katarina pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mnemonic.git


The following commit(s) were added to refs/heads/master by this push:
     new 2b5687b  MNEMONIC-806: Revitalized and Elevated Durable Customer
     new d272157  Merge pull request #366 from katarinaking/806
2b5687b is described below

commit 2b5687bfc86f8b9d3f170430d3259864fe994053
Author: Katarina <[email protected]>
AuthorDate: Wed Dec 20 20:02:55 2023 +0000

    MNEMONIC-806: Revitalized and Elevated Durable Customer
---
 .../org/apache/mnemonic/examples/Customer.java     | 68 ++++++++++++++++------
 1 file changed, 49 insertions(+), 19 deletions(-)

diff --git 
a/mnemonic-examples/src/main/java/org/apache/mnemonic/examples/Customer.java 
b/mnemonic-examples/src/main/java/org/apache/mnemonic/examples/Customer.java
index 56c30bb..7d9ce61 100644
--- a/mnemonic-examples/src/main/java/org/apache/mnemonic/examples/Customer.java
+++ b/mnemonic-examples/src/main/java/org/apache/mnemonic/examples/Customer.java
@@ -29,28 +29,58 @@ import org.apache.mnemonic.RetrieveDurableEntityError;
 @DurableEntity
 public abstract class Customer implements Durable {
 
-  @Override
-  public void initializeAfterCreate() {
-  }
+    /**
+     * This method is called after an instance of Customer is created.
+     */
+    @Override
+    public void initializeAfterCreate() {
+        // Initialization logic after creation (if needed)
+    }
 
-  @Override
-  public void initializeAfterRestore() {
-  }
+    /**
+     * This method is called after an instance of Customer is restored from 
durable memory.
+     */
+    @Override
+    public void initializeAfterRestore() {
+        // Initialization logic after restoration (if needed)
+    }
 
-  @Override
-  public void setupGenericInfo(EntityFactoryProxy[] efproxies, DurableType[] 
gftypes) {
+    /**
+     * Setup generic information for the entity.
+     *
+     * @param efproxies array of entity factory proxies
+     * @param gftypes   array of durable types
+     */
+    @Override
+    public void setupGenericInfo(EntityFactoryProxy[] efproxies, DurableType[] 
gftypes) {
+        // Setup generic information (if needed)
+    }
 
-  }
+    /**
+     * Getter method for the 'name' field.
+     *
+     * @return the name of the customer
+     * @throws RetrieveDurableEntityError if an error occurs during entity 
retrieval
+     */
+    @DurableGetter
+    public abstract String getName() throws RetrieveDurableEntityError;
 
-  @DurableGetter
-  public abstract String getName() throws RetrieveDurableEntityError;
-
-  @DurableSetter
-  public abstract void setName(String name, boolean destroy)
-      throws OutOfHybridMemory, RetrieveDurableEntityError;
-
-  public void show() {
-    System.out.printf("%s \n", getName());
-  }
+    /**
+     * Setter method for the 'name' field.
+     *
+     * @param name    the name to set for the customer
+     * @param destroy whether to destroy the previous value
+     * @throws OutOfHybridMemory         if there is not enough hybrid memory 
available
+     * @throws RetrieveDurableEntityError if an error occurs during entity 
retrieval
+     */
+    @DurableSetter
+    public abstract void setName(String name, boolean destroy)
+            throws OutOfHybridMemory, RetrieveDurableEntityError;
 
+    /**
+     * Display information about the customer.
+     */
+    public void show() {
+        System.out.printf("Customer Name: %s \n", getName());
+    }
 }

Reply via email to