Search in sources :

Example 1 with StructuredAddress

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.StructuredAddress in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getStructuredAddress.

public static StructuredAddress getStructuredAddress() {
    IDType id = getIdType("ID type 1", "5ryit6-5tj47e-45jfyr-4tu57fg");
    CodeType postcodeCode = getCodeType("Post code 1", "5ryit6-5tj47e-45jfyr-4tu57fg-rt54tgr");
    TextType buildingName = getTextType("Test Building");
    TextType streetName = getTextType("Test Street");
    TextType cityName = getTextType("Test City");
    IDType countryID = getIdType("Test Country", "ryfht53-fht5-6htfur-57thft");
    TextType citySubDivisionName = getTextType("Test city subdivision");
    TextType countryName = getTextType("Test Country");
    TextType countrySubDivisionName = getTextType("Test country subdivision");
    TextType blockName = getTextType("Test Block");
    TextType plotIdentification = getTextType("123");
    TextType postOfficeBox = getTextType("548675");
    TextType buildingNumber = getTextType("12345");
    TextType staircaseNumber = getTextType("3456");
    TextType floorIdentification = getTextType("8888");
    TextType roomIdentification = getTextType("555");
    TextType postalArea = getTextType("123");
    // StructuredAddress structuredAddress = new StructuredAddress();
    StructuredAddress structuredAddress = new StructuredAddress(id, postcodeCode, buildingName, streetName, cityName, countryID, citySubDivisionName, countryName, countrySubDivisionName, blockName, plotIdentification, postOfficeBox, buildingNumber, staircaseNumber, floorIdentification, roomIdentification, postalArea);
    /*    StructuredAddress structuredAddress = new StructuredAddress(id, postcodeCode, buildingName, streetName,
                cityName, countryID, citySubDivisionName, countryName, countrySubDivisionName, blockName, plotIdentification,
                postOfficeBox, buildingNumber, staircaseNumber, floorIdentification, roomIdentification);*/
    return structuredAddress;
}
Also used : CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) StructuredAddress(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.StructuredAddress) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)

Example 2 with StructuredAddress

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.StructuredAddress in project UVMS-ActivityModule-APP by UnionVMS.

the class FaCatchMapper method getFluxLocationEntities.

protected Set<FluxLocationEntity> getFluxLocationEntities(List<FLUXLocation> specifiedFluxLocations, List<FLUXLocation> destFluxLocations, FaCatchEntity faCatchEntity) {
    Set<FluxLocationEntity> fluxLocationEntities = new HashSet<>();
    if (specifiedFluxLocations != null && !specifiedFluxLocations.isEmpty()) {
        for (FLUXLocation fluxLocation : specifiedFluxLocations) {
            FluxLocationEntity fluxLocationEntity = FluxLocationMapper.INSTANCE.mapToFluxLocationEntity(fluxLocation);
            Set<StructuredAddressEntity> structuredAddressEntitySet = new HashSet<>();
            StructuredAddress physicalStructuredAddress = fluxLocation.getPhysicalStructuredAddress();
            StructuredAddressEntity physicalStructuredAddressEntity = StructuredAddressMapper.INSTANCE.mapToStructuredAddressEntity(physicalStructuredAddress);
            if (physicalStructuredAddressEntity != null) {
                physicalStructuredAddressEntity.setFluxLocation(fluxLocationEntity);
                physicalStructuredAddressEntity.setStructuredAddressType(StructuredAddressTypeEnum.FLUX_PHYSICAL.getType());
                structuredAddressEntitySet.add(physicalStructuredAddressEntity);
            }
            List<StructuredAddress> postalStructuredAddresses = fluxLocation.getPostalStructuredAddresses();
            if (postalStructuredAddresses != null && !postalStructuredAddresses.isEmpty()) {
                for (StructuredAddress structuredAddress : postalStructuredAddresses) {
                    StructuredAddressEntity structuredAddressEntity = StructuredAddressMapper.INSTANCE.mapToStructuredAddressEntity(structuredAddress);
                    if (structuredAddressEntity != null) {
                        structuredAddressEntity.setStructuredAddressType(StructuredAddressTypeEnum.FLUX_POSTAL.getType());
                        structuredAddressEntity.setFluxLocation(fluxLocationEntity);
                        structuredAddressEntitySet.add(structuredAddressEntity);
                    }
                }
            }
            fluxLocationEntity.setStructuredAddresses(structuredAddressEntitySet);
            fluxLocationEntity.setFaCatch(faCatchEntity);
            fluxLocationEntity.setFluxLocationType(FluxLocationCatchTypeEnum.FA_CATCH_SPECIFIED.getType());
            fluxLocationEntities.add(fluxLocationEntity);
        }
    }
    if (destFluxLocations != null && !destFluxLocations.isEmpty()) {
        for (FLUXLocation fluxLocation : destFluxLocations) {
            FluxLocationEntity fluxLocationEntity = FluxLocationMapper.INSTANCE.mapToFluxLocationEntity(fluxLocation);
            fluxLocationEntity.setFaCatch(faCatchEntity);
            fluxLocationEntity.setFluxLocationType(FluxLocationCatchTypeEnum.FA_CATCH_DESTINATION.getType());
            fluxLocationEntities.add(fluxLocationEntity);
        }
    }
    return fluxLocationEntities;
}
Also used : StructuredAddressEntity(eu.europa.ec.fisheries.ers.fa.entities.StructuredAddressEntity) FLUXLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation) StructuredAddress(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.StructuredAddress) FluxLocationEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxLocationEntity) HashSet(java.util.HashSet)

Example 3 with StructuredAddress

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.StructuredAddress in project UVMS-ActivityModule-APP by UnionVMS.

the class ContactPartyMapper method getStructuredAddressEntity.

protected Set<StructuredAddressEntity> getStructuredAddressEntity(List<StructuredAddress> structuredAddresses, ContactPartyEntity contactPartyEntity) {
    if (CollectionUtils.isEmpty(structuredAddresses)) {
        return Collections.emptySet();
    }
    Set<StructuredAddressEntity> structuredAddressEntities = new HashSet<>();
    for (StructuredAddress structuredAddress : structuredAddresses) {
        StructuredAddressEntity structuredAddressEntity = StructuredAddressMapper.INSTANCE.mapToStructuredAddressEntity(structuredAddress);
        structuredAddressEntity.setStructuredAddressType(StructuredAddressTypeEnum.CONTACT_PARTY_SPECIFIED.getType());
        structuredAddressEntity.setContactParty(contactPartyEntity);
        structuredAddressEntities.add(structuredAddressEntity);
    }
    return structuredAddressEntities;
}
Also used : StructuredAddressEntity(eu.europa.ec.fisheries.ers.fa.entities.StructuredAddressEntity) StructuredAddress(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.StructuredAddress) HashSet(java.util.HashSet)

Example 4 with StructuredAddress

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.StructuredAddress in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getFluxLocation.

public static FLUXLocation getFluxLocation() {
    FLUXLocation fluxLocation = new FLUXLocation();
    CodeType typeCode = getCodeType("AREA", "FLUX_LOCATION_TYPE");
    IDType countryID = getIdType("XEU", "TERRITORY");
    CodeType regionalFisheriesManagementOrganizationCode = getCodeType("RFMO1", "fhty58-gh586t-5tjf8-t58rjewe");
    FLUXGeographicalCoordinate specifiedPhysicalFLUXGeographicalCoordinate = getFluxGeographicalCoordinate();
    IDType id = getIdType("25.5b", "FAO_AREA");
    CodeType geopoliticalRegionCode = getCodeType("Code type 2", "fhty258-g3h586t-5t4jf8-t58rjew5e");
    List<TextType> names = Arrays.asList(getTextType("This is sample name"));
    IDType sovereignRightsCountryID = getIdType("sovereign rights id 1", "fhty58-gh5486t-5t5jf8-t58rjewe");
    IDType jurisdictionCountryID = getIdType("jurisdiction country id 1", "fht1y58-gh5876t-5t3jf8-t58rjewe");
    List<FLUXCharacteristic> applicableFLUXCharacteristics = null;
    List<StructuredAddress> postalStructuredAddresses = Arrays.asList(getStructuredAddress());
    StructuredAddress physicalStructuredAddress = getStructuredAddress();
    fluxLocation.setTypeCode(typeCode);
    fluxLocation.setCountryID(countryID);
    fluxLocation.setRegionalFisheriesManagementOrganizationCode(regionalFisheriesManagementOrganizationCode);
    fluxLocation.setSpecifiedPhysicalFLUXGeographicalCoordinate(specifiedPhysicalFLUXGeographicalCoordinate);
    fluxLocation.setID(id);
    fluxLocation.setGeopoliticalRegionCode(geopoliticalRegionCode);
    fluxLocation.setNames(names);
    fluxLocation.setSovereignRightsCountryID(sovereignRightsCountryID);
    fluxLocation.setJurisdictionCountryID(jurisdictionCountryID);
    fluxLocation.setApplicableFLUXCharacteristics(applicableFLUXCharacteristics);
    fluxLocation.setPostalStructuredAddresses(postalStructuredAddresses);
    fluxLocation.setPhysicalStructuredAddress(physicalStructuredAddress);
    return fluxLocation;
}
Also used : FLUXGeographicalCoordinate(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXGeographicalCoordinate) FLUXLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) StructuredAddress(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.StructuredAddress) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) FLUXCharacteristic(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic) TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)

Aggregations

StructuredAddress (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.StructuredAddress)4 StructuredAddressEntity (eu.europa.ec.fisheries.ers.fa.entities.StructuredAddressEntity)2 HashSet (java.util.HashSet)2 FLUXLocation (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation)2 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)2 IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)2 TextType (un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)2 FluxLocationEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxLocationEntity)1 FLUXCharacteristic (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic)1 FLUXGeographicalCoordinate (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXGeographicalCoordinate)1