org.entur.gbfs.mapper.StationStatusAdditionalMapperImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gbfs-mapper-java Show documentation
Show all versions of gbfs-mapper-java Show documentation
Enables mapping between different versions of GBFS (bidirectional)
package org.entur.gbfs.mapper;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.annotation.processing.Generated;
import org.mapstruct.factory.Mappers;
import org.mobilitydata.gbfs.v2_3.station_status.GBFSStation;
import org.mobilitydata.gbfs.v2_3.station_status.GBFSVehicleDocksAvailable;
import org.mobilitydata.gbfs.v3_0.station_status.GBFSVehicleTypesAvailable;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2024-10-07T00:56:04+0000",
comments = "version: 1.6.2, compiler: javac, environment: Java 17.0.11 (Eclipse Adoptium)"
)
public class StationStatusAdditionalMapperImpl extends StationStatusAdditionalMapper {
private final DateMapper dateMapper = Mappers.getMapper( DateMapper.class );
@Override
org.mobilitydata.gbfs.v3_0.station_status.GBFSStation mapStation(GBFSStation source) {
if ( source == null ) {
return null;
}
org.mobilitydata.gbfs.v3_0.station_status.GBFSStation gBFSStation = new org.mobilitydata.gbfs.v3_0.station_status.GBFSStation();
gBFSStation.setNumVehiclesAvailable( source.getNumBikesAvailable() );
gBFSStation.setNumVehiclesDisabled( source.getNumBikesDisabled() );
gBFSStation.setStationId( source.getStationId() );
gBFSStation.setVehicleTypesAvailable( gBFSVehicleTypesAvailableListToGBFSVehicleTypesAvailableList( source.getVehicleTypesAvailable() ) );
gBFSStation.setNumDocksAvailable( source.getNumDocksAvailable() );
gBFSStation.setNumDocksDisabled( source.getNumDocksDisabled() );
gBFSStation.setIsInstalled( source.getIsInstalled() );
gBFSStation.setIsRenting( source.getIsRenting() );
gBFSStation.setIsReturning( source.getIsReturning() );
gBFSStation.setLastReported( dateMapper.mapIntegerToDate( source.getLastReported() ) );
gBFSStation.setVehicleDocksAvailable( gBFSVehicleDocksAvailableListToGBFSVehicleDocksAvailableList( source.getVehicleDocksAvailable() ) );
if ( gBFSStation.getAdditionalProperties() != null ) {
Map map = source.getAdditionalProperties();
if ( map != null ) {
gBFSStation.getAdditionalProperties().putAll( map );
}
}
return gBFSStation;
}
@Override
GBFSStation mapStationInverse(org.mobilitydata.gbfs.v3_0.station_status.GBFSStation source) {
if ( source == null ) {
return null;
}
GBFSStation gBFSStation = new GBFSStation();
gBFSStation.setNumBikesAvailable( source.getNumVehiclesAvailable() );
gBFSStation.setNumBikesDisabled( source.getNumVehiclesDisabled() );
gBFSStation.setStationId( source.getStationId() );
gBFSStation.setVehicleTypesAvailable( gBFSVehicleTypesAvailableListToGBFSVehicleTypesAvailableList1( source.getVehicleTypesAvailable() ) );
gBFSStation.setNumDocksAvailable( source.getNumDocksAvailable() );
gBFSStation.setNumDocksDisabled( source.getNumDocksDisabled() );
gBFSStation.setIsInstalled( source.getIsInstalled() );
gBFSStation.setIsRenting( source.getIsRenting() );
gBFSStation.setIsReturning( source.getIsReturning() );
gBFSStation.setLastReported( dateMapper.mapDateToInteger( source.getLastReported() ) );
gBFSStation.setVehicleDocksAvailable( gBFSVehicleDocksAvailableListToGBFSVehicleDocksAvailableList1( source.getVehicleDocksAvailable() ) );
if ( gBFSStation.getAdditionalProperties() != null ) {
Map map = source.getAdditionalProperties();
if ( map != null ) {
gBFSStation.getAdditionalProperties().putAll( map );
}
}
return gBFSStation;
}
protected GBFSVehicleTypesAvailable gBFSVehicleTypesAvailableToGBFSVehicleTypesAvailable(org.mobilitydata.gbfs.v2_3.station_status.GBFSVehicleTypesAvailable gBFSVehicleTypesAvailable) {
if ( gBFSVehicleTypesAvailable == null ) {
return null;
}
GBFSVehicleTypesAvailable gBFSVehicleTypesAvailable1 = new GBFSVehicleTypesAvailable();
gBFSVehicleTypesAvailable1.setVehicleTypeId( gBFSVehicleTypesAvailable.getVehicleTypeId() );
gBFSVehicleTypesAvailable1.setCount( gBFSVehicleTypesAvailable.getCount() );
if ( gBFSVehicleTypesAvailable1.getAdditionalProperties() != null ) {
Map map = gBFSVehicleTypesAvailable.getAdditionalProperties();
if ( map != null ) {
gBFSVehicleTypesAvailable1.getAdditionalProperties().putAll( map );
}
}
return gBFSVehicleTypesAvailable1;
}
protected List gBFSVehicleTypesAvailableListToGBFSVehicleTypesAvailableList(List list) {
if ( list == null ) {
return null;
}
List list1 = new ArrayList( list.size() );
for ( org.mobilitydata.gbfs.v2_3.station_status.GBFSVehicleTypesAvailable gBFSVehicleTypesAvailable : list ) {
list1.add( gBFSVehicleTypesAvailableToGBFSVehicleTypesAvailable( gBFSVehicleTypesAvailable ) );
}
return list1;
}
protected org.mobilitydata.gbfs.v3_0.station_status.GBFSVehicleDocksAvailable gBFSVehicleDocksAvailableToGBFSVehicleDocksAvailable(GBFSVehicleDocksAvailable gBFSVehicleDocksAvailable) {
if ( gBFSVehicleDocksAvailable == null ) {
return null;
}
org.mobilitydata.gbfs.v3_0.station_status.GBFSVehicleDocksAvailable gBFSVehicleDocksAvailable1 = new org.mobilitydata.gbfs.v3_0.station_status.GBFSVehicleDocksAvailable();
List list = gBFSVehicleDocksAvailable.getVehicleTypeIds();
if ( list != null ) {
gBFSVehicleDocksAvailable1.setVehicleTypeIds( new ArrayList( list ) );
}
gBFSVehicleDocksAvailable1.setCount( gBFSVehicleDocksAvailable.getCount() );
if ( gBFSVehicleDocksAvailable1.getAdditionalProperties() != null ) {
Map map = gBFSVehicleDocksAvailable.getAdditionalProperties();
if ( map != null ) {
gBFSVehicleDocksAvailable1.getAdditionalProperties().putAll( map );
}
}
return gBFSVehicleDocksAvailable1;
}
protected List gBFSVehicleDocksAvailableListToGBFSVehicleDocksAvailableList(List list) {
if ( list == null ) {
return null;
}
List list1 = new ArrayList( list.size() );
for ( GBFSVehicleDocksAvailable gBFSVehicleDocksAvailable : list ) {
list1.add( gBFSVehicleDocksAvailableToGBFSVehicleDocksAvailable( gBFSVehicleDocksAvailable ) );
}
return list1;
}
protected org.mobilitydata.gbfs.v2_3.station_status.GBFSVehicleTypesAvailable gBFSVehicleTypesAvailableToGBFSVehicleTypesAvailable1(GBFSVehicleTypesAvailable gBFSVehicleTypesAvailable) {
if ( gBFSVehicleTypesAvailable == null ) {
return null;
}
org.mobilitydata.gbfs.v2_3.station_status.GBFSVehicleTypesAvailable gBFSVehicleTypesAvailable1 = new org.mobilitydata.gbfs.v2_3.station_status.GBFSVehicleTypesAvailable();
gBFSVehicleTypesAvailable1.setVehicleTypeId( gBFSVehicleTypesAvailable.getVehicleTypeId() );
gBFSVehicleTypesAvailable1.setCount( gBFSVehicleTypesAvailable.getCount() );
if ( gBFSVehicleTypesAvailable1.getAdditionalProperties() != null ) {
Map map = gBFSVehicleTypesAvailable.getAdditionalProperties();
if ( map != null ) {
gBFSVehicleTypesAvailable1.getAdditionalProperties().putAll( map );
}
}
return gBFSVehicleTypesAvailable1;
}
protected List gBFSVehicleTypesAvailableListToGBFSVehicleTypesAvailableList1(List list) {
if ( list == null ) {
return null;
}
List list1 = new ArrayList( list.size() );
for ( GBFSVehicleTypesAvailable gBFSVehicleTypesAvailable : list ) {
list1.add( gBFSVehicleTypesAvailableToGBFSVehicleTypesAvailable1( gBFSVehicleTypesAvailable ) );
}
return list1;
}
protected GBFSVehicleDocksAvailable gBFSVehicleDocksAvailableToGBFSVehicleDocksAvailable1(org.mobilitydata.gbfs.v3_0.station_status.GBFSVehicleDocksAvailable gBFSVehicleDocksAvailable) {
if ( gBFSVehicleDocksAvailable == null ) {
return null;
}
GBFSVehicleDocksAvailable gBFSVehicleDocksAvailable1 = new GBFSVehicleDocksAvailable();
List list = gBFSVehicleDocksAvailable.getVehicleTypeIds();
if ( list != null ) {
gBFSVehicleDocksAvailable1.setVehicleTypeIds( new ArrayList( list ) );
}
gBFSVehicleDocksAvailable1.setCount( gBFSVehicleDocksAvailable.getCount() );
if ( gBFSVehicleDocksAvailable1.getAdditionalProperties() != null ) {
Map map = gBFSVehicleDocksAvailable.getAdditionalProperties();
if ( map != null ) {
gBFSVehicleDocksAvailable1.getAdditionalProperties().putAll( map );
}
}
return gBFSVehicleDocksAvailable1;
}
protected List gBFSVehicleDocksAvailableListToGBFSVehicleDocksAvailableList1(List list) {
if ( list == null ) {
return null;
}
List list1 = new ArrayList( list.size() );
for ( org.mobilitydata.gbfs.v3_0.station_status.GBFSVehicleDocksAvailable gBFSVehicleDocksAvailable : list ) {
list1.add( gBFSVehicleDocksAvailableToGBFSVehicleDocksAvailable1( gBFSVehicleDocksAvailable ) );
}
return list1;
}
}