Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import javax.xml.namespace.QName;

public class Main {
    public static boolean isEqual(QName qn1, QName qn2, boolean ignoreCase) {
        if (qn1 == null && qn2 == null) {
            return true;
        }

        if (qn1 != null && qn2 != null && isEqual(qn1.getLocalPart(), qn2.getLocalPart(), ignoreCase)
                && isEqual(qn1.getNamespaceURI(), qn2.getNamespaceURI(), ignoreCase)) {
            return true;
        }

        return false;

    }

    public static boolean isEqual(String str1, String str2, boolean ignoreCase) {
        if (str1 == null && str2 == null) {
            return true;
        }

        if (str1 != null && str2 != null) {
            if (ignoreCase) {
                return str1.equalsIgnoreCase(str2);
            } else {
                return str1.equals(str2);
            }
        }

        return false;
    }
}