// Path: address-service/src/main/java/de/codecentric/resilient/address/repository/AddressRepository.java
// public interface AddressRepository extends CrudRepository<Address, Long>, QueryByExampleExecutor<Address> {
// 
// }
// 
// Path: address-service/src/main/java/de/codecentric/resilient/address/entity/Address.java
// @Entity
// public class Address {
// 
//     @Id
//     @GeneratedValue
//     private Long id;
// 
//     private String country;
// 
//     private String city;
// 
//     private String postcode;
// 
//     private String street;
// 
//     private String streetNumber;
// 
//     public Address() {
//     }
// 
//     /***
//      *
//      * @param country
//      * @param city
//      * @param postcode
//      * @param street
//      * @param streetNumber
//      */
//     public Address(String country, String city, String postcode, String street, String streetNumber) {
//         this.country = country;
//         this.city = city;
//         this.postcode = postcode;
//         this.street = street;
//         this.streetNumber = streetNumber;
//     }
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     public String getCountry() {
//         return country;
//     }
// 
//     public void setCountry(String country) {
//         this.country = country;
//     }
// 
//     public String getCity() {
//         return city;
//     }
// 
//     public void setCity(String city) {
//         this.city = city;
//     }
// 
//     public String getPostcode() {
//         return postcode;
//     }
// 
//     public void setPostcode(String postcode) {
//         this.postcode = postcode;
//     }
// 
//     public String getStreet() {
//         return street;
//     }
// 
//     public void setStreet(String street) {
//         this.street = street;
//     }
// 
//     public String getStreetNumber() {
//         return streetNumber;
//     }
// 
//     public void setStreetNumber(String streetNumber) {
//         this.streetNumber = streetNumber;
//     }
// }
// 
// Path: service-library/src/main/java/de/codecentric/resilient/dto/AddressDTO.java
// @JsonInclude(JsonInclude.Include.NON_NULL)
// public class AddressDTO  {
// 
//     @JsonProperty(required = true)
//     private String country;
// 
//     @JsonProperty(required = true)
//     private String city;
// 
//     @JsonProperty(required = true)
//     private String postcode;
// 
//     @JsonProperty(required = true)
//     private String street;
// 
//     @JsonProperty(required = true)
//     private String streetNumber;
// 
//     public AddressDTO() {
//     }
// 
//     public AddressDTO(String country, String city, String postcode, String street, String streetNumber) {
//         this.country = country;
//         this.city = city;
//         this.postcode = postcode;
//         this.street = street;
//         this.streetNumber = streetNumber;
//     }
// 
//     public String getCountry() {
//         return country;
//     }
// 
//     public void setCountry(String country) {
//         this.country = country;
//     }
// 
//     public String getCity() {
//         return city;
//     }
// 
//     public void setCity(String city) {
//         this.city = city;
//     }
// 
//     public String getPostcode() {
//         return postcode;
//     }
// 
//     public void setPostcode(String postcode) {
//         this.postcode = postcode;
//     }
// 
//     public String getStreet() {
//         return street;
//     }
// 
//     public void setStreet(String street) {
//         this.street = street;
//     }
// 
//     public String getStreetNumber() {
//         return streetNumber;
//     }
// 
//     public void setStreetNumber(String streetNumber) {
//         this.streetNumber = streetNumber;
//     }
// 
//     @Override
//     public String toString() {
//         final StringBuilder sb = new StringBuilder("AddressDTO{");
//         sb.append("country='").append(country).append('\'');
//         sb.append(", city='").append(city).append('\'');
//         sb.append(", postcode='").append(postcode).append('\'');
//         sb.append(", street='").append(street).append('\'');
//         sb.append(", streetNumber='").append(streetNumber).append('\'');
//         sb.append('}');
//         return sb.toString();
//     }
// }


import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains;
import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.startsWith;
import de.codecentric.resilient.address.repository.AddressRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.ExampleMatcher;
import org.springframework.stereotype.Service;
import de.codecentric.resilient.address.entity.Address;
import de.codecentric.resilient.dto.AddressDTO;
package de.codecentric.resilient.address.service;



/**
 * @author Benjamin Wilms (xd98870)
 */
@Service
public class AddressService {

    private final AddressRepository addressRepository;

    @Autowired
    public AddressService(AddressRepository addressRepository) {
        this.addressRepository = addressRepository;
    }

// Path: address-service/src/main/java/de/codecentric/resilient/address/repository/AddressRepository.java
// public interface AddressRepository extends CrudRepository<Address, Long>, QueryByExampleExecutor<Address> {
// 
// }
// 
// Path: address-service/src/main/java/de/codecentric/resilient/address/entity/Address.java
// @Entity
// public class Address {
// 
//     @Id
//     @GeneratedValue
//     private Long id;
// 
//     private String country;
// 
//     private String city;
// 
//     private String postcode;
// 
//     private String street;
// 
//     private String streetNumber;
// 
//     public Address() {
//     }
// 
//     /***
//      *
//      * @param country
//      * @param city
//      * @param postcode
//      * @param street
//      * @param streetNumber
//      */
//     public Address(String country, String city, String postcode, String street, String streetNumber) {
//         this.country = country;
//         this.city = city;
//         this.postcode = postcode;
//         this.street = street;
//         this.streetNumber = streetNumber;
//     }
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     public String getCountry() {
//         return country;
//     }
// 
//     public void setCountry(String country) {
//         this.country = country;
//     }
// 
//     public String getCity() {
//         return city;
//     }
// 
//     public void setCity(String city) {
//         this.city = city;
//     }
// 
//     public String getPostcode() {
//         return postcode;
//     }
// 
//     public void setPostcode(String postcode) {
//         this.postcode = postcode;
//     }
// 
//     public String getStreet() {
//         return street;
//     }
// 
//     public void setStreet(String street) {
//         this.street = street;
//     }
// 
//     public String getStreetNumber() {
//         return streetNumber;
//     }
// 
//     public void setStreetNumber(String streetNumber) {
//         this.streetNumber = streetNumber;
//     }
// }
// 
// Path: service-library/src/main/java/de/codecentric/resilient/dto/AddressDTO.java
// @JsonInclude(JsonInclude.Include.NON_NULL)
// public class AddressDTO  {
// 
//     @JsonProperty(required = true)
//     private String country;
// 
//     @JsonProperty(required = true)
//     private String city;
// 
//     @JsonProperty(required = true)
//     private String postcode;
// 
//     @JsonProperty(required = true)
//     private String street;
// 
//     @JsonProperty(required = true)
//     private String streetNumber;
// 
//     public AddressDTO() {
//     }
// 
//     public AddressDTO(String country, String city, String postcode, String street, String streetNumber) {
//         this.country = country;
//         this.city = city;
//         this.postcode = postcode;
//         this.street = street;
//         this.streetNumber = streetNumber;
//     }
// 
//     public String getCountry() {
//         return country;
//     }
// 
//     public void setCountry(String country) {
//         this.country = country;
//     }
// 
//     public String getCity() {
//         return city;
//     }
// 
//     public void setCity(String city) {
//         this.city = city;
//     }
// 
//     public String getPostcode() {
//         return postcode;
//     }
// 
//     public void setPostcode(String postcode) {
//         this.postcode = postcode;
//     }
// 
//     public String getStreet() {
//         return street;
//     }
// 
//     public void setStreet(String street) {
//         this.street = street;
//     }
// 
//     public String getStreetNumber() {
//         return streetNumber;
//     }
// 
//     public void setStreetNumber(String streetNumber) {
//         this.streetNumber = streetNumber;
//     }
// 
//     @Override
//     public String toString() {
//         final StringBuilder sb = new StringBuilder("AddressDTO{");
//         sb.append("country='").append(country).append('\'');
//         sb.append(", city='").append(city).append('\'');
//         sb.append(", postcode='").append(postcode).append('\'');
//         sb.append(", street='").append(street).append('\'');
//         sb.append(", streetNumber='").append(streetNumber).append('\'');
//         sb.append('}');
//         return sb.toString();
//     }
// }


// Path: address-service/src/main/java/de/codecentric/resilient/address/service/AddressService.java
import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains;
import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.startsWith;
import de.codecentric.resilient.address.repository.AddressRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.ExampleMatcher;
import org.springframework.stereotype.Service;
import de.codecentric.resilient.address.entity.Address;
import de.codecentric.resilient.dto.AddressDTO;

package de.codecentric.resilient.address.service;



/**
 * @author Benjamin Wilms (xd98870)
 */
@Service
public class AddressService {

    private final AddressRepository addressRepository;

    @Autowired
    public AddressService(AddressRepository addressRepository) {
        this.addressRepository = addressRepository;
    }

    public Address validateAddress(AddressDTO addressDTO) {