
org.openwms.common.location.LocationGroupMapperImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.openwms.common.service.lib Show documentation
Show all versions of org.openwms.common.service.lib Show documentation
A library with essential functionality on common resources like Locations, LocationGroups and TransportUnits
The newest version!
package org.openwms.common.location;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import javax.annotation.processing.Generated;
import org.openwms.common.account.Account;
import org.openwms.common.location.api.LocationGroupVO;
import org.openwms.common.location.api.messages.LocationGroupMO;
import org.springframework.stereotype.Component;
@Generated(
value = "org.mapstruct.ap.MappingProcessor"
)
@Component
public class LocationGroupMapperImpl extends LocationGroupMapper {
@Override
public LocationGroupVO convertToVO(LocationGroup eo) {
if ( eo == null ) {
return null;
}
LocationGroupVO locationGroupVO = new LocationGroupVO();
if ( eo.hasPersistentKey() ) {
locationGroupVO.setpKey( eo.getPersistentKey() );
}
locationGroupVO.setAccountId( eoAccountIdentifier( eo ) );
String name = eoParentName( eo );
if ( eo.hasParent() ) {
locationGroupVO.setParent( name );
}
locationGroupVO.setGroupStateIn( eo.getGroupStateIn() );
locationGroupVO.setGroupStateOut( eo.getGroupStateOut() );
if ( eo.hasLocationGroups() ) {
locationGroupVO.setChildren( locationGroupSetToLocationGroupVOList( eo.getLocationGroups() ) );
}
locationGroupVO.setCreateDt( eo.getCreateDt() );
locationGroupVO.setOperationMode( eo.getOperationMode() );
locationGroupVO.setName( eo.getName() );
locationGroupVO.setDescription( eo.getDescription() );
locationGroupVO.setGroupType( eo.getGroupType() );
return locationGroupVO;
}
@Override
public LocationGroupMO convertToMO(LocationGroup eo) {
if ( eo == null ) {
return null;
}
LocationGroupMO locationGroupMO = new LocationGroupMO();
locationGroupMO.setAccountId( eoAccountIdentifier( eo ) );
String name = eoParentName( eo );
if ( eo.hasParent() ) {
locationGroupMO.setParent( name );
}
locationGroupMO.setOperationMode( eo.getOperationMode() );
locationGroupMO.setName( eo.getName() );
locationGroupMO.setIncomingActive( eo.isInfeedAllowed() );
locationGroupMO.setOutgoingActive( eo.isOutfeedAllowed() );
return locationGroupMO;
}
@Override
public List convertToVO(List eo) {
if ( eo == null ) {
return null;
}
List list = new ArrayList( eo.size() );
for ( LocationGroup locationGroup : eo ) {
list.add( convertToVO( locationGroup ) );
}
return list;
}
private String eoAccountIdentifier(LocationGroup locationGroup) {
Account account = locationGroup.getAccount();
if ( account == null ) {
return null;
}
return account.getIdentifier();
}
private String eoParentName(LocationGroup locationGroup) {
if ( !locationGroup.hasParent() ) {
return null;
}
LocationGroup parent = locationGroup.getParent();
return parent.getName();
}
protected List locationGroupSetToLocationGroupVOList(Set set) {
if ( set == null ) {
return null;
}
List list = new ArrayList( set.size() );
for ( LocationGroup locationGroup : set ) {
list.add( convertToVO( locationGroup ) );
}
return list;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy