Package is.bokun.dtos

Examples of is.bokun.dtos.CapacityDto


        return findMinimumCapacity(null);
    }

    @JsonIgnore
    public CapacityDto findMinimumCapacity(Long fareClassId) {
        CapacityDto c = null;
        for (AvailableLegDto leg : departurePath) {
            for (AvailableSeatsDto seats : leg.departure.availableSeats) {
                if ( fareClassId == null || ("fareclass_" + fareClassId).equals(seats.fareClassId) ) {
                    if ( c == null || (seats.capacity.capacityType != CapacityTypeEnum.UNLIMITED && seats.capacity.capacity < c.capacity)) {
                        c = seats.capacity;
                    }
                }
            }
        }
        if ( !returning && returnPath != null ) {
            for (AvailableLegDto leg : returnPath) {
                for (AvailableSeatsDto seats : leg.departure.availableSeats) {
                    if ( fareClassId == null || ("fareclass_" + fareClassId).equals(seats.fareClassId) ) {
                        if ( c == null || (seats.capacity.capacityType != CapacityTypeEnum.UNLIMITED && seats.capacity.capacity < c.capacity)) {
                            c = seats.capacity;
                        }
                    }
                }
            }
        }

        if ( c == null ) {
            return new CapacityDto(CapacityTypeEnum.LIMITED, 0);
        } else {
            return c;
        }
    }
View Full Code Here

TOP

Related Classes of is.bokun.dtos.CapacityDto

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.