All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.entur.gbfs.mapper.StationInformationAdditionalMapperImpl Maven / Gradle / Ivy

The newest version!
package org.entur.gbfs.mapper;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.annotation.processing.Generated;
import org.mobilitydata.gbfs.v3_0.station_information.GBFSRentalUris;
import org.mobilitydata.gbfs.v3_0.station_information.GBFSStation;
import org.mobilitydata.gbfs.v3_0.station_information.RentalMethod;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2024-12-23T09:49:14+0000",
    comments = "version: 1.6.3, compiler: javac, environment: Java 17.0.13 (BellSoft)"
)
public class StationInformationAdditionalMapperImpl extends StationInformationAdditionalMapper {

    @Override
    GBFSStation mapStation(org.mobilitydata.gbfs.v2_3.station_information.GBFSStation source, String language) {
        if ( source == null ) {
            return null;
        }

        GBFSStation gBFSStation = new GBFSStation();

        gBFSStation.setVehicleTypesCapacity( mapVehicleTypeAreaCapacity( source.getVehicleCapacity() ) );
        gBFSStation.setVehicleDocksCapacity( mapVehicleTypeDockCapacity( source.getVehicleTypeCapacity() ) );
        gBFSStation.setStationId( source.getStationId() );
        gBFSStation.setName( mapName( source.getName(), language ) );
        gBFSStation.setShortName( mapShortName( source.getShortName(), language ) );
        gBFSStation.setLat( source.getLat() );
        gBFSStation.setLon( source.getLon() );
        gBFSStation.setAddress( source.getAddress() );
        gBFSStation.setCrossStreet( source.getCrossStreet() );
        gBFSStation.setRegionId( source.getRegionId() );
        gBFSStation.setPostCode( source.getPostCode() );
        gBFSStation.setRentalMethods( rentalMethodListToRentalMethodList( source.getRentalMethods(), language ) );
        gBFSStation.setIsVirtualStation( source.getIsVirtualStation() );
        gBFSStation.setStationArea( source.getStationArea() );
        gBFSStation.setParkingType( parkingTypeToParkingType( source.getParkingType(), language ) );
        gBFSStation.setParkingHoop( source.getParkingHoop() );
        gBFSStation.setContactPhone( source.getContactPhone() );
        gBFSStation.setCapacity( source.getCapacity() );
        gBFSStation.setIsValetStation( source.getIsValetStation() );
        gBFSStation.setIsChargingStation( source.getIsChargingStation() );
        gBFSStation.setRentalUris( gBFSRentalUrisToGBFSRentalUris( source.getRentalUris(), language ) );
        if ( gBFSStation.getAdditionalProperties() != null ) {
            Map map = source.getAdditionalProperties();
            if ( map != null ) {
                gBFSStation.getAdditionalProperties().putAll( map );
            }
        }

        return gBFSStation;
    }

    @Override
    org.mobilitydata.gbfs.v2_3.station_information.GBFSStation mapStationInverse(GBFSStation source, String language) {
        if ( source == null ) {
            return null;
        }

        org.mobilitydata.gbfs.v2_3.station_information.GBFSStation gBFSStation = new org.mobilitydata.gbfs.v2_3.station_information.GBFSStation();

        gBFSStation.setVehicleCapacity( mapVehicleTypeAreaCapacityInverse( source.getVehicleTypesCapacity() ) );
        gBFSStation.setVehicleTypeCapacity( mapVehicleTypeDockCapacityInverse( source.getVehicleDocksCapacity() ) );
        gBFSStation.setStationId( source.getStationId() );
        gBFSStation.setName( mapNameInverse( source.getName(), language ) );
        gBFSStation.setShortName( mapShortNameInverse( source.getShortName(), language ) );
        gBFSStation.setLat( source.getLat() );
        gBFSStation.setLon( source.getLon() );
        gBFSStation.setAddress( source.getAddress() );
        gBFSStation.setCrossStreet( source.getCrossStreet() );
        gBFSStation.setRegionId( source.getRegionId() );
        gBFSStation.setPostCode( source.getPostCode() );
        gBFSStation.setRentalMethods( rentalMethodListToRentalMethodList1( source.getRentalMethods(), language ) );
        gBFSStation.setIsVirtualStation( source.getIsVirtualStation() );
        gBFSStation.setStationArea( source.getStationArea() );
        gBFSStation.setParkingType( parkingTypeToParkingType1( source.getParkingType(), language ) );
        gBFSStation.setParkingHoop( source.getParkingHoop() );
        gBFSStation.setContactPhone( source.getContactPhone() );
        gBFSStation.setCapacity( source.getCapacity() );
        gBFSStation.setIsValetStation( source.getIsValetStation() );
        gBFSStation.setIsChargingStation( source.getIsChargingStation() );
        gBFSStation.setRentalUris( gBFSRentalUrisToGBFSRentalUris1( source.getRentalUris(), language ) );
        if ( gBFSStation.getAdditionalProperties() != null ) {
            Map map = source.getAdditionalProperties();
            if ( map != null ) {
                gBFSStation.getAdditionalProperties().putAll( map );
            }
        }

        return gBFSStation;
    }

    protected RentalMethod rentalMethodToRentalMethod(org.mobilitydata.gbfs.v2_3.station_information.RentalMethod rentalMethod, String language) {
        if ( rentalMethod == null ) {
            return null;
        }

        RentalMethod rentalMethod1;

        switch ( rentalMethod ) {
            case KEY: rentalMethod1 = RentalMethod.KEY;
            break;
            case CREDITCARD: rentalMethod1 = RentalMethod.CREDITCARD;
            break;
            case PAYPASS: rentalMethod1 = RentalMethod.PAYPASS;
            break;
            case APPLEPAY: rentalMethod1 = RentalMethod.APPLEPAY;
            break;
            case ANDROIDPAY: rentalMethod1 = RentalMethod.ANDROIDPAY;
            break;
            case TRANSITCARD: rentalMethod1 = RentalMethod.TRANSITCARD;
            break;
            case ACCOUNTNUMBER: rentalMethod1 = RentalMethod.ACCOUNTNUMBER;
            break;
            case PHONE: rentalMethod1 = RentalMethod.PHONE;
            break;
            default: throw new IllegalArgumentException( "Unexpected enum constant: " + rentalMethod );
        }

        return rentalMethod1;
    }

    protected List rentalMethodListToRentalMethodList(List list, String language) {
        if ( list == null ) {
            return null;
        }

        List list1 = new ArrayList( list.size() );
        for ( org.mobilitydata.gbfs.v2_3.station_information.RentalMethod rentalMethod : list ) {
            list1.add( rentalMethodToRentalMethod( rentalMethod, language ) );
        }

        return list1;
    }

    protected GBFSStation.ParkingType parkingTypeToParkingType(org.mobilitydata.gbfs.v2_3.station_information.GBFSStation.ParkingType parkingType, String language) {
        if ( parkingType == null ) {
            return null;
        }

        GBFSStation.ParkingType parkingType1;

        switch ( parkingType ) {
            case PARKING_LOT: parkingType1 = GBFSStation.ParkingType.PARKING_LOT;
            break;
            case STREET_PARKING: parkingType1 = GBFSStation.ParkingType.STREET_PARKING;
            break;
            case UNDERGROUND_PARKING: parkingType1 = GBFSStation.ParkingType.UNDERGROUND_PARKING;
            break;
            case SIDEWALK_PARKING: parkingType1 = GBFSStation.ParkingType.SIDEWALK_PARKING;
            break;
            case OTHER: parkingType1 = GBFSStation.ParkingType.OTHER;
            break;
            default: throw new IllegalArgumentException( "Unexpected enum constant: " + parkingType );
        }

        return parkingType1;
    }

    protected GBFSRentalUris gBFSRentalUrisToGBFSRentalUris(org.mobilitydata.gbfs.v2_3.station_information.GBFSRentalUris gBFSRentalUris, String language) {
        if ( gBFSRentalUris == null ) {
            return null;
        }

        GBFSRentalUris gBFSRentalUris1 = new GBFSRentalUris();

        gBFSRentalUris1.setAndroid( gBFSRentalUris.getAndroid() );
        gBFSRentalUris1.setIos( gBFSRentalUris.getIos() );
        gBFSRentalUris1.setWeb( gBFSRentalUris.getWeb() );
        if ( gBFSRentalUris1.getAdditionalProperties() != null ) {
            Map map = gBFSRentalUris.getAdditionalProperties();
            if ( map != null ) {
                gBFSRentalUris1.getAdditionalProperties().putAll( map );
            }
        }

        return gBFSRentalUris1;
    }

    protected org.mobilitydata.gbfs.v2_3.station_information.RentalMethod rentalMethodToRentalMethod1(RentalMethod rentalMethod, String language) {
        if ( rentalMethod == null ) {
            return null;
        }

        org.mobilitydata.gbfs.v2_3.station_information.RentalMethod rentalMethod1;

        switch ( rentalMethod ) {
            case KEY: rentalMethod1 = org.mobilitydata.gbfs.v2_3.station_information.RentalMethod.KEY;
            break;
            case CREDITCARD: rentalMethod1 = org.mobilitydata.gbfs.v2_3.station_information.RentalMethod.CREDITCARD;
            break;
            case PAYPASS: rentalMethod1 = org.mobilitydata.gbfs.v2_3.station_information.RentalMethod.PAYPASS;
            break;
            case APPLEPAY: rentalMethod1 = org.mobilitydata.gbfs.v2_3.station_information.RentalMethod.APPLEPAY;
            break;
            case ANDROIDPAY: rentalMethod1 = org.mobilitydata.gbfs.v2_3.station_information.RentalMethod.ANDROIDPAY;
            break;
            case TRANSITCARD: rentalMethod1 = org.mobilitydata.gbfs.v2_3.station_information.RentalMethod.TRANSITCARD;
            break;
            case ACCOUNTNUMBER: rentalMethod1 = org.mobilitydata.gbfs.v2_3.station_information.RentalMethod.ACCOUNTNUMBER;
            break;
            case PHONE: rentalMethod1 = org.mobilitydata.gbfs.v2_3.station_information.RentalMethod.PHONE;
            break;
            default: throw new IllegalArgumentException( "Unexpected enum constant: " + rentalMethod );
        }

        return rentalMethod1;
    }

    protected List rentalMethodListToRentalMethodList1(List list, String language) {
        if ( list == null ) {
            return null;
        }

        List list1 = new ArrayList( list.size() );
        for ( RentalMethod rentalMethod : list ) {
            list1.add( rentalMethodToRentalMethod1( rentalMethod, language ) );
        }

        return list1;
    }

    protected org.mobilitydata.gbfs.v2_3.station_information.GBFSStation.ParkingType parkingTypeToParkingType1(GBFSStation.ParkingType parkingType, String language) {
        if ( parkingType == null ) {
            return null;
        }

        org.mobilitydata.gbfs.v2_3.station_information.GBFSStation.ParkingType parkingType1;

        switch ( parkingType ) {
            case PARKING_LOT: parkingType1 = org.mobilitydata.gbfs.v2_3.station_information.GBFSStation.ParkingType.PARKING_LOT;
            break;
            case STREET_PARKING: parkingType1 = org.mobilitydata.gbfs.v2_3.station_information.GBFSStation.ParkingType.STREET_PARKING;
            break;
            case UNDERGROUND_PARKING: parkingType1 = org.mobilitydata.gbfs.v2_3.station_information.GBFSStation.ParkingType.UNDERGROUND_PARKING;
            break;
            case SIDEWALK_PARKING: parkingType1 = org.mobilitydata.gbfs.v2_3.station_information.GBFSStation.ParkingType.SIDEWALK_PARKING;
            break;
            case OTHER: parkingType1 = org.mobilitydata.gbfs.v2_3.station_information.GBFSStation.ParkingType.OTHER;
            break;
            default: throw new IllegalArgumentException( "Unexpected enum constant: " + parkingType );
        }

        return parkingType1;
    }

    protected org.mobilitydata.gbfs.v2_3.station_information.GBFSRentalUris gBFSRentalUrisToGBFSRentalUris1(GBFSRentalUris gBFSRentalUris, String language) {
        if ( gBFSRentalUris == null ) {
            return null;
        }

        org.mobilitydata.gbfs.v2_3.station_information.GBFSRentalUris gBFSRentalUris1 = new org.mobilitydata.gbfs.v2_3.station_information.GBFSRentalUris();

        gBFSRentalUris1.setAndroid( gBFSRentalUris.getAndroid() );
        gBFSRentalUris1.setIos( gBFSRentalUris.getIos() );
        gBFSRentalUris1.setWeb( gBFSRentalUris.getWeb() );
        if ( gBFSRentalUris1.getAdditionalProperties() != null ) {
            Map map = gBFSRentalUris.getAdditionalProperties();
            if ( map != null ) {
                gBFSRentalUris1.getAdditionalProperties().putAll( map );
            }
        }

        return gBFSRentalUris1;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy