package com.github.swalffy.comparator.room;

import java.util.Comparator;

import com.github.swalffy.bean.Room;

public class PriceComparator implements Comparator<Room>{

	public int compare(Room r1, Room r2) {
		if (r1 != null && r2 != null) {
			return r1.getPrice().compareTo(r2.getPrice());
		}
		if (r1 != null && r2 == null) {
			return -1;
		} else {
			return 1;
		}
	}
}


