KAN-4 : Add a pet to the petstore

Added uppercase name
This commit is contained in:
Wim Jongman 2025-05-09 12:52:11 +02:00
parent c5af32d5a1
commit 9e817f1a97

View file

@ -20,9 +20,12 @@ import jakarta.persistence.MappedSuperclass;
import jakarta.validation.constraints.NotBlank;
/**
* Simple JavaBean domain object adds a name property to <code>BaseEntity</code>. Used as
* Simple JavaBean domain object adds a name property to
* <code>BaseEntity</code>. Used as
* a base class for objects needing these properties.
*
* Added one more line to clarify.
*
* @author Ken Krebs
* @author Juergen Hoeller
* @author Wick Dynex
@ -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();