コード例 #1
0
 /**
  * Compare this MBeanParameterInfo to another.
  *
  * @param o the object to compare to.
  * @return true if and only if <code>o</code> is an MBeanParameterInfo such that its {@link
  *     #getName()}, {@link #getType()}, {@link #getDescriptor()}, and {@link #getDescription()}
  *     values are equal (not necessarily identical) to those of this MBeanParameterInfo.
  */
 public boolean equals(Object o) {
   if (o == this) return true;
   if (!(o instanceof MBeanParameterInfo)) return false;
   MBeanParameterInfo p = (MBeanParameterInfo) o;
   return (Objects.equals(p.getName(), getName())
       && Objects.equals(p.getType(), getType())
       && Objects.equals(p.getDescription(), getDescription())
       && Objects.equals(p.getDescriptor(), getDescriptor()));
 }
コード例 #2
0
ファイル: JmxUtils.java プロジェクト: EvilJohn/fuseide
  public static final String getOperationName(MBeanOperationInfo info) {
    StringBuilder name = new StringBuilder(info.getName());
    name.append('(');

    MBeanParameterInfo[] parameterInfos = info.getSignature();

    if (parameterInfos != null) {

      int parameterCount = parameterInfos.length;
      for (int i = 0; i < parameterCount; i++) {
        MBeanParameterInfo parameterInfo = parameterInfos[i];
        String parameterType = getTypeName(parameterInfo.getType(), parameterInfo.getDescriptor());
        name.append(parameterType);

        if (i < parameterCount - 1) {
          name.append(", ");
        }
      }
    }

    name.append(')');
    return name.toString();
  }