Java MBean infoEquals(MBeanInfo one, MBeanInfo two)

Here you can find the source of infoEquals(MBeanInfo one, MBeanInfo two)

Description

info Equals

License

Open Source License

Declaration

public static boolean infoEquals(MBeanInfo one, MBeanInfo two) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2006 Jeff Mesnil//from www  . j a va  2s .com
 * 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
 *******************************************************************************/

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

  1. getMBeanServerObjectName()
  2. getOperation(MBeanInfo info, String opName)
  3. getProxy(MBeanServerConnection connection, ObjectName objectName, final Class objectClass)
  4. getServerId(MBeanServer server)
  5. infoArrayEquals(MBeanParameterInfo[] a, MBeanParameterInfo[] a2)
  6. invoke(Logger logger, MBeanServer mbeanServer, ObjectName mbeanName, String methodName, Object... arguments)
  7. invoke(MBeanServer mbs, ObjectName name, String operationName, Object params[], String signature[])
  8. invokeStopOperation(ObjectName name, MBeanServer server)
  9. isRegistered(MBeanServer mbs, ObjectName objectName)