MBeanInfo Equals - Java javax.management

Java examples for javax.management:MBean

Description

MBeanInfo Equals

Demo Code

/*******************************************************************************
 * Copyright (c) 2006 Jeff Mesnil// ww  w  . j a va  2s . c o  m
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    "Rob Stryker" <rob.stryker@redhat.com> - Initial implementation
 *******************************************************************************/
//package com.java2s;
import javax.management.MBeanInfo;

public class Main {
    public static boolean infoEquals(MBeanInfo one, MBeanInfo two) {
        if (one == two)
            return true;
        if (!safeStringEquals(one.getClassName(), two.getClassName())
                || !safeStringEquals(one.getDescription(),
                        two.getDescription()))
            return false;
        return true;
    }

    public static boolean safeStringEquals(String one, String two) {
        if (one == null)
            return two == null;
        return one.equals(two);
    }
}

Related Tutorials