Java MBean paramEquals(MBeanParameterInfo o1, MBeanParameterInfo o2)

Here you can find the source of paramEquals(MBeanParameterInfo o1, MBeanParameterInfo o2)

Description

param Equals

License

Open Source License

Declaration

public static boolean paramEquals(MBeanParameterInfo o1, MBeanParameterInfo o2) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2006 Jeff Mesnil//from  w  ww. ja v a  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.MBeanParameterInfo;

public class Main {
    public static boolean paramEquals(MBeanParameterInfo o1, MBeanParameterInfo o2) {
        if (o1 == o2)
            return true;
        return (o1.getName().equals(o2.getName()) && o1.getType().equals(o2.getType()) && safeEquals(
                o1.getDescription(), o2.getDescription()) /*&&
                                                          o1.getDescriptor().equals(o2.getDescriptor())*/);
    }

    public static boolean safeEquals(Object o1, Object o2) {
        return o1 == o2 || !(o1 == null || o2 == null) || o1.equals(o2);
    }
}

Related

  1. mBeanAttributes2String(MBeanAttributeInfo[] attributeInfoArray)
  2. newMBeanProxy(final MBeanServerConnection conn, final ObjectName objectName, final Class interfaceClass)
  3. objectNameFor(Logger logger, String mbeanName)
  4. onameForBean(final Object mbean, final String name)
  5. operationEquals(MBeanOperationInfo one, MBeanOperationInfo two)
  6. queryAndGetAttribute(MBeanServerConnection connection, String domain, String name, String type, String scope, String attribute)
  7. queryConnectionBy(MBeanServerConnection connection, ObjectName objectName)
  8. readAttribute(MBeanServer mbeanServer, String mbeanName, String attributeName)
  9. registerMBean(MBeanServer mbs, Object object, ObjectName name, boolean unreg)