mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:35:50 +00:00
KAN-4 : Add a pet to the petstore
Added uppercase name
This commit is contained in:
parent
c5af32d5a1
commit
9e817f1a97
1 changed files with 13 additions and 1 deletions
|
@ -20,8 +20,11 @@ import jakarta.persistence.MappedSuperclass;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
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.
|
* a base class for objects needing these properties.
|
||||||
|
*
|
||||||
|
* Added one more line to clarify.
|
||||||
*
|
*
|
||||||
* @author Ken Krebs
|
* @author Ken Krebs
|
||||||
* @author Juergen Hoeller
|
* @author Juergen Hoeller
|
||||||
|
@ -42,6 +45,15 @@ public class NamedEntity extends BaseEntity {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the name in uppercase.
|
||||||
|
*
|
||||||
|
* @return the name in uppercase
|
||||||
|
*/
|
||||||
|
public String getNameUpper() {
|
||||||
|
return this.name.toUpperCase();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return this.getName();
|
return this.getName();
|
||||||
|
|
Loading…
Reference in a new issue