Examples/src/main/java/org/openestate/io/examples/CasaItWritingExample.java
protected static Realestate createRealestate() {
        // create an example real estate
        Realestate obj = FACTORY.createContainerRealestateitemsRealestate();
        obj.setAction(BigInteger.ONE);
        obj.setAgencycode(0);
        obj.setBathrooms(BigInteger.valueOf(RandomUtils.nextLong(1, 5)));
        obj.setCondition(BigInteger.ONE);
        obj.setContracttype(BigInteger.ONE);
        obj.setFloor(BigInteger.valueOf(RandomUtils.nextLong(1, 5)));
        obj.setHasbalcony(RandomUtils.nextInt(0, 2) == 1);
        obj.setHasterrace(RandomUtils.nextInt(0, 2) == 1);
        obj.setHeatingtype(BigInteger.ONE);
        obj.setHousetypology(BigInteger.ONE);
        obj.setOccupationstate(BigInteger.ONE);
        obj.setRealestatetype(BigInteger.ONE);
        obj.setReference(RandomStringUtils.random(5));
        obj.setReferenceID(RandomUtils.nextInt(1, 1000));
        obj.setRooms(BigInteger.valueOf(RandomUtils.nextLong(1, 10)));
        obj.setSize(BigInteger.valueOf(RandomUtils.nextLong(50, 5000)));

        obj.setAddress(FACTORY.createContainerRealestateitemsRealestateAddress());
        obj.getAddress().setCity("Berlin");
        obj.getAddress().setNumber("123");
        obj.getAddress().setStreet("example street");
        obj.getAddress().setZip("12345");
        obj.getAddress().setZone("Berlin");

        obj.setBox(FACTORY.createContainerRealestateitemsRealestateBox());
        obj.getBox().setSize(BigInteger.valueOf(RandomUtils.nextLong(50, 1000)));
        obj.getBox().setType(BigInteger.ONE);

        obj.setBuilding(FACTORY.createContainerRealestateitemsRealestateBuilding());
        obj.getBuilding().setAge(BigInteger.valueOf(RandomUtils.nextLong(5, 50)));
        obj.getBuilding().setExpenses(BigDecimal.valueOf(RandomUtils.nextDouble(1000, 1000000)));
        obj.getBuilding().setHaslift(RandomUtils.nextInt(0, 2) == 1);
        obj.getBuilding().setTotalfloors(BigInteger.valueOf(RandomUtils.nextLong(1, 5)));
        obj.getBuilding().setUnits(BigInteger.ONE);

        obj.setConfiguration(FACTORY.createContainerRealestateitemsRealestateConfiguration());
        obj.getConfiguration().setIsaddressvisibleonsite(RandomUtils.nextInt(0, 2) == 1);
        obj.getConfiguration().setIsmapvisible(RandomUtils.nextInt(0, 2) == 1);
        obj.getConfiguration().setIsrealestatevisibleonmap(RandomUtils.nextInt(0, 2) == 1);

        obj.setDescription(FACTORY.createContainerRealestateitemsRealestateDescription());
        obj.getDescription().setValue("a nice little description for the object");

        obj.setGarden(FACTORY.createContainerRealestateitemsRealestateGarden());
        obj.getGarden().setSize(BigInteger.valueOf(RandomUtils.nextLong(10, 100)));
        obj.getGarden().setType(BigInteger.ONE);

        obj.setGooglemapcoordinate(FACTORY.createContainerRealestateitemsRealestateGooglemapcoordinate());
        obj.getGooglemapcoordinate().setLatitude(BigDecimal.valueOf(RandomUtils.nextDouble(0, 90)));
        obj.getGooglemapcoordinate().setLatitudemapcenter(BigDecimal.valueOf(RandomUtils.nextDouble(0, 90)));
        obj.getGooglemapcoordinate().setLongitude(BigDecimal.valueOf(RandomUtils.nextDouble(0, 90)));
        obj.getGooglemapcoordinate().setLongitudemapcenter(BigDecimal.valueOf(RandomUtils.nextDouble(0, 90)));
        obj.getGooglemapcoordinate().setMapzoom(10);

        obj.setImages(FACTORY.createContainerRealestateitemsRealestateImages());
        obj.getImages().getAdvertismentimage().add(createAdvertismentimage());
        obj.getImages().getAdvertismentimage().add(createAdvertismentimage());
        obj.getImages().getAdvertismentimage().add(createAdvertismentimage());

        obj.setPrice(FACTORY.createContainerRealestateitemsRealestatePrice());
        obj.getPrice().setMax(BigDecimal.valueOf(RandomUtils.nextDouble(1000, 1000000)));
        obj.getPrice().setMin(BigDecimal.valueOf(RandomUtils.nextDouble(1000, 1000000)));
        obj.getPrice().setValue(BigDecimal.valueOf(RandomUtils.nextDouble(1000, 1000000)));

        return obj;
    }
protected static Realestate createRealestate() {
        // create an example real estate
        Realestate obj = FACTORY.createContainerRealestateitemsRealestate();
        obj.setAction(BigInteger.ONE);
        obj.setAgencycode(0);
        obj.setBathrooms(BigInteger.valueOf(RandomUtils.nextLong(1, 5)));
        obj.setCondition(BigInteger.ONE);
        obj.setContracttype(BigInteger.ONE);
        obj.setFloor(BigInteger.valueOf(RandomUtils.nextLong(1, 5)));
        obj.setHasbalcony(RandomUtils.nextInt(0, 2) == 1);
        obj.setHasterrace(RandomUtils.nextInt(0, 2) == 1);
        obj.setHeatingtype(BigInteger.ONE);
        obj.setHousetypology(BigInteger.ONE);
        obj.setOccupationstate(BigInteger.ONE);
        obj.setRealestatetype(BigInteger.ONE);
        obj.setReference(RandomStringUtils.random(5));
        obj.setReferenceID(RandomUtils.nextInt(1, 1000));
        obj.setRooms(BigInteger.valueOf(RandomUtils.nextLong(1, 10)));
        obj.setSize(BigInteger.valueOf(RandomUtils.nextLong(50, 5000)));

        obj.setAddress(FACTORY.createContainerRealestateitemsRealestateAddress());
        obj.getAddress().setCity("Berlin");
        obj.getAddress().setNumber("123");
        obj.getAddress().setStreet("example street");
        obj.getAddress().setZip("12345");
        obj.getAddress().setZone("Berlin");

        obj.setBox(FACTORY.createContainerRealestateitemsRealestateBox());
        obj.getBox().setSize(BigInteger.valueOf(RandomUtils.nextLong(50, 1000)));
        obj.getBox().setType(BigInteger.ONE);

        obj.setBuilding(FACTORY.createContainerRealestateitemsRealestateBuilding());
        obj.getBuilding().setAge(BigInteger.valueOf(RandomUtils.nextLong(5, 50)));
        obj.getBuilding().setExpenses(BigDecimal.valueOf(RandomUtils.nextDouble(1000, 1000000)));
        obj.getBuilding().setHaslift(RandomUtils.nextInt(0, 2) == 1);
        obj.getBuilding().setTotalfloors(BigInteger.valueOf(RandomUtils.nextLong(1, 5)));
        obj.getBuilding().setUnits(BigInteger.ONE);

        obj.setConfiguration(FACTORY.createContainerRealestateitemsRealestateConfiguration());
        obj.getConfiguration().setIsaddressvisibleonsite(RandomUtils.nextInt(0, 2) == 1);
        obj.getConfiguration().setIsmapvisible(RandomUtils.nextInt(0, 2) == 1);
        obj.getConfiguration().setIsrealestatevisibleonmap(RandomUtils.nextInt(0, 2) == 1);

        obj.setDescription(FACTORY.createContainerRealestateitemsRealestateDescription());
        obj.getDescription().setValue("a nice little description for the object");

        obj.setGarden(FACTORY.createContainerRealestateitemsRealestateGarden());
        obj.getGarden().setSize(BigInteger.valueOf(RandomUtils.nextLong(10, 100)));
        obj.getGarden().setType(BigInteger.ONE);

        obj.setGooglemapcoordinate(FACTORY.createContainerRealestateitemsRealestateGooglemapcoordinate());
        obj.getGooglemapcoordinate().setLatitude(BigDecimal.valueOf(RandomUtils.nextDouble(0, 90)));
        obj.getGooglemapcoordinate().setLatitudemapcenter(BigDecimal.valueOf(RandomUtils.nextDouble(0, 90)));
        obj.getGooglemapcoordinate().setLongitude(BigDecimal.valueOf(RandomUtils.nextDouble(0, 90)));
        obj.getGooglemapcoordinate().setLongitudemapcenter(BigDecimal.valueOf(RandomUtils.nextDouble(0, 90)));
        obj.getGooglemapcoordinate().setMapzoom(10);

        obj.setImages(FACTORY.createContainerRealestateitemsRealestateImages());
        obj.getImages().getAdvertismentimage().add(createAdvertismentimage());
        obj.getImages().getAdvertismentimage().add(createAdvertismentimage());
        obj.getImages().getAdvertismentimage().add(createAdvertismentimage());

        obj.setPrice(FACTORY.createContainerRealestateitemsRealestatePrice());
        obj.getPrice().setMax(BigDecimal.valueOf(RandomUtils.nextDouble(1000, 1000000)));
        obj.getPrice().setMin(BigDecimal.valueOf(RandomUtils.nextDouble(1000, 1000000)));
        obj.getPrice().setValue(BigDecimal.valueOf(RandomUtils.nextDouble(1000, 1000000)));

        return obj;
    }
protected static Realestate createRealestate ( ) { // create an example real estate Realestate obj = FACTORY . createContainerRealestateitemsRealestate ( ) ; obj . setAction ( BigInteger . ONE ) ; obj . setAgencycode ( 0 ) ; obj . setBathrooms ( BigInteger . valueOf ( RandomUtils . nextLong ( 1 , 5 ) ) ) ; obj . setCondition ( BigInteger . ONE ) ; obj . setContracttype ( BigInteger . ONE ) ; obj . setFloor ( BigInteger . valueOf ( RandomUtils . nextLong ( 1 , 5 ) ) ) ; obj . setHasbalcony ( RandomUtils . nextInt ( 0 , 2 ) == 1 ) ; obj . setHasterrace ( RandomUtils . nextInt ( 0 , 2 ) == 1 ) ; obj . setHeatingtype ( BigInteger . ONE ) ; obj . setHousetypology ( BigInteger . ONE ) ; obj . setOccupationstate ( BigInteger . ONE ) ; obj . setRealestatetype ( BigInteger . ONE ) ; obj . setReference ( RandomStringUtils . random ( 5 ) ) ; obj . setReferenceID ( RandomUtils . nextInt ( 1 , 1000 ) ) ; obj . setRooms ( BigInteger . valueOf ( RandomUtils . nextLong ( 1 , 10 ) ) ) ; obj . setSize ( BigInteger . valueOf ( RandomUtils . nextLong ( 50 , 5000 ) ) ) ; obj . setAddress ( FACTORY . createContainerRealestateitemsRealestateAddress ( ) ) ; obj . getAddress ( ) . setCity ( "Berlin" ) ; obj . getAddress ( ) . setNumber ( "123" ) ; obj . getAddress ( ) . setStreet ( "example street" ) ; obj . getAddress ( ) . setZip ( "12345" ) ; obj . getAddress ( ) . setZone ( "Berlin" ) ; obj . setBox ( FACTORY . createContainerRealestateitemsRealestateBox ( ) ) ; obj . getBox ( ) . setSize ( BigInteger . valueOf ( RandomUtils . nextLong ( 50 , 1000 ) ) ) ; obj . getBox ( ) . setType ( BigInteger . ONE ) ; obj . setBuilding ( FACTORY . createContainerRealestateitemsRealestateBuilding ( ) ) ; obj . getBuilding ( ) . setAge ( BigInteger . valueOf ( RandomUtils . nextLong ( 5 , 50 ) ) ) ; obj . getBuilding ( ) . setExpenses ( BigDecimal . valueOf ( RandomUtils . nextDouble ( 1000 , 1000000 ) ) ) ; obj . getBuilding ( ) . setHaslift ( RandomUtils . nextInt ( 0 , 2 ) == 1 ) ; obj . getBuilding ( ) . setTotalfloors ( BigInteger . valueOf ( RandomUtils . nextLong ( 1 , 5 ) ) ) ; obj . getBuilding ( ) . setUnits ( BigInteger . ONE ) ; obj . setConfiguration ( FACTORY . createContainerRealestateitemsRealestateConfiguration ( ) ) ; obj . getConfiguration ( ) . setIsaddressvisibleonsite ( RandomUtils . nextInt ( 0 , 2 ) == 1 ) ; obj . getConfiguration ( ) . setIsmapvisible ( RandomUtils . nextInt ( 0 , 2 ) == 1 ) ; obj . getConfiguration ( ) . setIsrealestatevisibleonmap ( RandomUtils . nextInt ( 0 , 2 ) == 1 ) ; obj . setDescription ( FACTORY . createContainerRealestateitemsRealestateDescription ( ) ) ; obj . getDescription ( ) . setValue ( "a nice little description for the object" ) ; obj . setGarden ( FACTORY . createContainerRealestateitemsRealestateGarden ( ) ) ; obj . getGarden ( ) . setSize ( BigInteger . valueOf ( RandomUtils . nextLong ( 10 , 100 ) ) ) ; obj . getGarden ( ) . setType ( BigInteger . ONE ) ; obj . setGooglemapcoordinate ( FACTORY . createContainerRealestateitemsRealestateGooglemapcoordinate ( ) ) ; obj . getGooglemapcoordinate ( ) . setLatitude ( BigDecimal . valueOf ( RandomUtils . nextDouble ( 0 , 90 ) ) ) ; obj . getGooglemapcoordinate ( ) . setLatitudemapcenter ( BigDecimal . valueOf ( RandomUtils . nextDouble ( 0 , 90 ) ) ) ; obj . getGooglemapcoordinate ( ) . setLongitude ( BigDecimal . valueOf ( RandomUtils . nextDouble ( 0 , 90 ) ) ) ; obj . getGooglemapcoordinate ( ) . setLongitudemapcenter ( BigDecimal . valueOf ( RandomUtils . nextDouble ( 0 , 90 ) ) ) ; obj . getGooglemapcoordinate ( ) . setMapzoom ( 10 ) ; obj . setImages ( FACTORY . createContainerRealestateitemsRealestateImages ( ) ) ; obj . getImages ( ) . getAdvertismentimage ( ) . add ( createAdvertismentimage ( ) ) ; obj . getImages ( ) . getAdvertismentimage ( ) . add ( createAdvertismentimage ( ) ) ; obj . getImages ( ) . getAdvertismentimage ( ) . add ( createAdvertismentimage ( ) ) ; obj . setPrice ( FACTORY . createContainerRealestateitemsRealestatePrice ( ) ) ; obj . getPrice ( ) . setMax ( BigDecimal . valueOf ( RandomUtils . nextDouble ( 1000 , 1000000 ) ) ) ; obj . getPrice ( ) . setMin ( BigDecimal . valueOf ( RandomUtils . nextDouble ( 1000 , 1000000 ) ) ) ; obj . getPrice ( ) . setValue ( BigDecimal . valueOf ( RandomUtils . nextDouble ( 1000 , 1000000 ) ) ) ; return obj ; }
Create a {@link Realestate} with some example data.

@return created example object
Create a { @link Realestate } with some example data .