package com.agilex.vamf.utils;

public class NullSafeStringComparer {
	public static boolean areEqual(String a, String b) {
		boolean matched;
		if (a == null && b == null)
			matched = true;
		else if (a == null && b != null)
			matched = false;
		else if (a != null && b == null)
			matched = false;
		else if (b.contentEquals(a))
			matched = true;
		else
			matched = false;
		return matched;
	}
	
	public static boolean areEqualIgnoreCase(String a, String b) {
		String lowerA = (a == null) ? null : a.toLowerCase();
		String lowerB = (b == null) ? null : b.toLowerCase();
		
		return areEqual(lowerA, lowerB);
	}
}
