From 9e817f1a9737fda6c400edb22d151b602d6953b0 Mon Sep 17 00:00:00 2001 From: Wim Jongman Date: Fri, 9 May 2025 12:52:11 +0200 Subject: [PATCH] KAN-4 : Add a pet to the petstore Added uppercase name --- .../samples/petclinic/model/NamedEntity.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/springframework/samples/petclinic/model/NamedEntity.java b/src/main/java/org/springframework/samples/petclinic/model/NamedEntity.java index 012e8c4be..fa71ad43f 100644 --- a/src/main/java/org/springframework/samples/petclinic/model/NamedEntity.java +++ b/src/main/java/org/springframework/samples/petclinic/model/NamedEntity.java @@ -20,8 +20,11 @@ import jakarta.persistence.MappedSuperclass; import jakarta.validation.constraints.NotBlank; /** - * Simple JavaBean domain object adds a name property to BaseEntity. Used as + * Simple JavaBean domain object adds a name property to + * BaseEntity. Used as * a base class for objects needing these properties. + * + * Added one more line to clarify. * * @author Ken Krebs * @author Juergen Hoeller @@ -42,6 +45,15 @@ public class NamedEntity extends BaseEntity { this.name = name; } + /** + * Returns the name in uppercase. + * + * @return the name in uppercase + */ + public String getNameUpper() { + return this.name.toUpperCase(); + } + @Override public String toString() { return this.getName();