Andrei Branza - replaced tabs si 4 spaces. eliminated not needed clone method in Address class from shallow and deep copy

This commit is contained in:
Andrei Branza 2024-02-24 21:09:58 +02:00
parent 9a421159ea
commit 65437b41ad
4 changed files with 29 additions and 49 deletions

View File

@ -7,19 +7,9 @@ import lombok.*;
@AllArgsConstructor
@EqualsAndHashCode
@ToString
public class Address implements Cloneable
{
public class Address implements Cloneable {
private String streetName;
private String cityName;
@Override
public Address clone() {
try
{
return (Address) super.clone();
} catch (CloneNotSupportedException cloneException)
{
throw new RuntimeException(cloneException);
}
}
}

View File

@ -7,8 +7,8 @@ import lombok.*;
@AllArgsConstructor
@EqualsAndHashCode
@ToString
public class Person implements Cloneable
{
public class Person implements Cloneable {
private String firstName;
private String lastName;
private Address address;

View File

@ -7,19 +7,9 @@ import lombok.*;
@AllArgsConstructor
@EqualsAndHashCode
@ToString
public class Address implements Cloneable
{
public class Address implements Cloneable {
private String streetName;
private String cityName;
@Override
public Address clone() {
try
{
return (Address) super.clone();
} catch (CloneNotSupportedException cloneException)
{
throw new RuntimeException(cloneException);
}
}
}

View File

@ -7,8 +7,8 @@ import lombok.*;
@AllArgsConstructor
@EqualsAndHashCode
@ToString
public class Person implements Cloneable
{
public class Person implements Cloneable {
private String firstName;
private String lastName;
private Address address;