org.entur.gbfs.mapper.GeofencingZonesAdditionalMapperImpl 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.mobilitydata.gbfs.v2_3.geofencing_zones.GBFSRule;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2024-09-23T00:21:26+0000",
comments = "version: 1.6.2, compiler: javac, environment: Java 17.0.11 (Eclipse Adoptium)"
)
public class GeofencingZonesAdditionalMapperImpl extends GeofencingZonesAdditionalMapper {
@Override
org.mobilitydata.gbfs.v3_0.geofencing_zones.GBFSRule mapRule(GBFSRule source) {
if ( source == null ) {
return null;
}
org.mobilitydata.gbfs.v3_0.geofencing_zones.GBFSRule gBFSRule = new org.mobilitydata.gbfs.v3_0.geofencing_zones.GBFSRule();
gBFSRule.setRideStartAllowed( source.getRideAllowed() );
gBFSRule.setRideEndAllowed( source.getRideAllowed() );
List list = source.getVehicleTypeId();
if ( list != null ) {
gBFSRule.setVehicleTypeIds( new ArrayList( list ) );
}
gBFSRule.setRideThroughAllowed( source.getRideThroughAllowed() );
gBFSRule.setMaximumSpeedKph( source.getMaximumSpeedKph() );
gBFSRule.setStationParking( source.getStationParking() );
if ( gBFSRule.getAdditionalProperties() != null ) {
Map map = source.getAdditionalProperties();
if ( map != null ) {
gBFSRule.getAdditionalProperties().putAll( map );
}
}
return gBFSRule;
}
@Override
GBFSRule mapRuleInverse(org.mobilitydata.gbfs.v3_0.geofencing_zones.GBFSRule source) {
if ( source == null ) {
return null;
}
GBFSRule gBFSRule = new GBFSRule();
List list = source.getVehicleTypeIds();
if ( list != null ) {
gBFSRule.setVehicleTypeId( new ArrayList( list ) );
}
gBFSRule.setRideThroughAllowed( source.getRideThroughAllowed() );
gBFSRule.setMaximumSpeedKph( source.getMaximumSpeedKph() );
gBFSRule.setStationParking( source.getStationParking() );
if ( gBFSRule.getAdditionalProperties() != null ) {
Map map = source.getAdditionalProperties();
if ( map != null ) {
gBFSRule.getAdditionalProperties().putAll( map );
}
}
gBFSRule.setRideAllowed( source.getRideStartAllowed() && source.getRideEndAllowed() );
return gBFSRule;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy