Examples/src/main/java/org/openestate/io/examples/DaftIeWritingExample.java
@SuppressWarnings("CatchMayIgnoreException")
    protected static OverseasRentalAdType createAdForRent() {
        // create an example real estate for rent
        OverseasRentalAdType ad = FACTORY.createOverseasRentalAdType();
        ad.setAddress("Beispielstraße 123");
        ad.setAgentId("123");
        ad.setArea("Berlin");
        ad.setAvailableFrom(Calendar.getInstance());
        ad.setBathroomNumber(BigInteger.valueOf(RandomUtils.nextInt(0, 5)));
        ad.setBedroomNumber(BigInteger.valueOf(RandomUtils.nextInt(0, 5)));
        ad.setCableTelevision(RandomUtils.nextInt(0, 2) == 1);
        ad.setCcEmail("test@openestate.org");
        ad.setCommercialType(CommercialType.LAND);
        ad.setContactName("Max Mustermann");
        ad.setCountry("DE");
        ad.setDescription("A description about the property.");
        ad.setDishwasher(RandomUtils.nextInt(0, 2) == 1);
        ad.setDoubleBeds(BigInteger.valueOf(RandomUtils.nextInt(0, 5)));
        ad.setDryer(RandomUtils.nextInt(0, 2) == 1);
        ad.setExternalId(String.valueOf(RandomUtils.nextInt(1, 1000)));
        ad.setFurnished(OverseasRentalAdType.Furnished.FURNISHED);
        ad.setHouseType(HouseType.TOWNHOUSE);
        ad.setLease(BigInteger.valueOf(RandomUtils.nextInt(100, 1000)));
        ad.setMainEmail("test@openstate.org");
        ad.setMicrowave(RandomUtils.nextInt(0, 2) == 1);
        ad.setNumberPeople(BigInteger.valueOf(RandomUtils.nextInt(0, 5)));
        ad.setPhone1("030/123456");
        ad.setPhone2("030/123457");
        ad.setPhoneInfo("Some information about contacts via phone.");
        ad.setPropertyType(PropertyType.HOUSE);
        ad.setRegion("Berlin");
        ad.setRent(BigInteger.valueOf(RandomUtils.nextInt(100, 1000)));
        ad.setRentCollectionPeriod(OverseasRentalAdType.RentPeriod.MONTHLY);
        ad.setSingleBeds(BigInteger.valueOf(RandomUtils.nextInt(0, 5)));
        ad.setTwinBeds(BigInteger.valueOf(RandomUtils.nextInt(0, 5)));
        ad.setWashingMachine(RandomUtils.nextInt(0, 2) == 1);

        // add some features
        ad.setFeatures(FACTORY.createFeaturesType());
        ad.getFeatures().getFeature().add("another feature");
        ad.getFeatures().getFeature().add("some more feature");

        // add some photos
        ad.setPhotos(FACTORY.createPhotosType());
        try {
            ad.getPhotos().getPhoto().add(new URI("http://www.mywebsite.org/image1.jpg"));
            ad.getPhotos().getPhoto().add(new URI("http://www.mywebsite.org/image2.jpg"));
            ad.getPhotos().getPhoto().add(new URI("http://www.mywebsite.org/image3.jpg"));
        } catch (URISyntaxException ex) {
        }

        return ad;
    }
@SuppressWarnings("CatchMayIgnoreException")
    protected static OverseasRentalAdType createAdForRent() {
        // create an example real estate for rent
        OverseasRentalAdType ad = FACTORY.createOverseasRentalAdType();
        ad.setAddress("Beispielstraße 123");
        ad.setAgentId("123");
        ad.setArea("Berlin");
        ad.setAvailableFrom(Calendar.getInstance());
        ad.setBathroomNumber(BigInteger.valueOf(RandomUtils.nextInt(0, 5)));
        ad.setBedroomNumber(BigInteger.valueOf(RandomUtils.nextInt(0, 5)));
        ad.setCableTelevision(RandomUtils.nextInt(0, 2) == 1);
        ad.setCcEmail("test@openestate.org");
        ad.setCommercialType(CommercialType.LAND);
        ad.setContactName("Max Mustermann");
        ad.setCountry("DE");
        ad.setDescription("A description about the property.");
        ad.setDishwasher(RandomUtils.nextInt(0, 2) == 1);
        ad.setDoubleBeds(BigInteger.valueOf(RandomUtils.nextInt(0, 5)));
        ad.setDryer(RandomUtils.nextInt(0, 2) == 1);
        ad.setExternalId(String.valueOf(RandomUtils.nextInt(1, 1000)));
        ad.setFurnished(OverseasRentalAdType.Furnished.FURNISHED);
        ad.setHouseType(HouseType.TOWNHOUSE);
        ad.setLease(BigInteger.valueOf(RandomUtils.nextInt(100, 1000)));
        ad.setMainEmail("test@openstate.org");
        ad.setMicrowave(RandomUtils.nextInt(0, 2) == 1);
        ad.setNumberPeople(BigInteger.valueOf(RandomUtils.nextInt(0, 5)));
        ad.setPhone1("030/123456");
        ad.setPhone2("030/123457");
        ad.setPhoneInfo("Some information about contacts via phone.");
        ad.setPropertyType(PropertyType.HOUSE);
        ad.setRegion("Berlin");
        ad.setRent(BigInteger.valueOf(RandomUtils.nextInt(100, 1000)));
        ad.setRentCollectionPeriod(OverseasRentalAdType.RentPeriod.MONTHLY);
        ad.setSingleBeds(BigInteger.valueOf(RandomUtils.nextInt(0, 5)));
        ad.setTwinBeds(BigInteger.valueOf(RandomUtils.nextInt(0, 5)));
        ad.setWashingMachine(RandomUtils.nextInt(0, 2) == 1);

        // add some features
        ad.setFeatures(FACTORY.createFeaturesType());
        ad.getFeatures().getFeature().add("another feature");
        ad.getFeatures().getFeature().add("some more feature");

        // add some photos
        ad.setPhotos(FACTORY.createPhotosType());
        try {
            ad.getPhotos().getPhoto().add(new URI("http://www.mywebsite.org/image1.jpg"));
            ad.getPhotos().getPhoto().add(new URI("http://www.mywebsite.org/image2.jpg"));
            ad.getPhotos().getPhoto().add(new URI("http://www.mywebsite.org/image3.jpg"));
        } catch (URISyntaxException ex) {
        }

        return ad;
    }
Create an {@link OverseasRentalAdType} with some example data.

@return created example object