0N/A/*
2362N/A * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A
0N/Apackage javax.management.openmbean;
0N/A
0N/A
0N/A// java import
0N/A//
0N/Aimport java.util.Set;
0N/Aimport java.lang.Comparable; // to be substituted for jdk1.1.x
0N/A
0N/A
0N/A// jmx import
0N/A//
0N/A
0N/A
0N/A/**
0N/A * <p>Describes a parameter used in one or more operations or
0N/A * constructors of an open MBean.</p>
0N/A *
0N/A * <p>This interface declares the same methods as the class {@link
0N/A * javax.management.MBeanParameterInfo}. A class implementing this
0N/A * interface (typically {@link OpenMBeanParameterInfoSupport}) should
0N/A * extend {@link javax.management.MBeanParameterInfo}.</p>
0N/A *
0N/A *
0N/A * @since 1.5
0N/A */
0N/Apublic interface OpenMBeanParameterInfo {
0N/A
0N/A
0N/A // Re-declares methods that are in class MBeanParameterInfo of JMX 1.0
0N/A // (these will be removed when MBeanParameterInfo is made a parent interface of this interface)
0N/A
0N/A /**
0N/A * Returns a human readable description of the parameter
0N/A * described by this <tt>OpenMBeanParameterInfo</tt> instance.
0N/A *
0N/A * @return the description.
0N/A */
0N/A public String getDescription() ;
0N/A
0N/A /**
0N/A * Returns the name of the parameter
0N/A * described by this <tt>OpenMBeanParameterInfo</tt> instance.
0N/A *
0N/A * @return the name.
0N/A */
0N/A public String getName() ;
0N/A
0N/A
0N/A // Now declares methods that are specific to open MBeans
0N/A //
0N/A
0N/A /**
0N/A * Returns the <i>open type</i> of the values of the parameter
0N/A * described by this <tt>OpenMBeanParameterInfo</tt> instance.
0N/A *
0N/A * @return the open type.
0N/A */
0N/A public OpenType<?> getOpenType() ;
0N/A
0N/A /**
0N/A * Returns the default value for this parameter, if it has one, or
0N/A * <tt>null</tt> otherwise.
0N/A *
0N/A * @return the default value.
0N/A */
0N/A public Object getDefaultValue() ;
0N/A
0N/A /**
0N/A * Returns the set of legal values for this parameter, if it has
0N/A * one, or <tt>null</tt> otherwise.
0N/A *
0N/A * @return the set of legal values.
0N/A */
0N/A public Set<?> getLegalValues() ;
0N/A
0N/A /**
0N/A * Returns the minimal value for this parameter, if it has one, or
0N/A * <tt>null</tt> otherwise.
0N/A *
0N/A * @return the minimum value.
0N/A */
0N/A public Comparable<?> getMinValue() ;
0N/A
0N/A /**
0N/A * Returns the maximal value for this parameter, if it has one, or
0N/A * <tt>null</tt> otherwise.
0N/A *
0N/A * @return the maximum value.
0N/A */
0N/A public Comparable<?> getMaxValue() ;
0N/A
0N/A /**
0N/A * Returns <tt>true</tt> if this parameter has a specified default
0N/A * value, or <tt>false</tt> otherwise.
0N/A *
0N/A * @return true if there is a default value.
0N/A */
0N/A public boolean hasDefaultValue() ;
0N/A
0N/A /**
0N/A * Returns <tt>true</tt> if this parameter has a specified set of
0N/A * legal values, or <tt>false</tt> otherwise.
0N/A *
0N/A * @return true if there is a set of legal values.
0N/A */
0N/A public boolean hasLegalValues() ;
0N/A
0N/A /**
0N/A * Returns <tt>true</tt> if this parameter has a specified minimal
0N/A * value, or <tt>false</tt> otherwise.
0N/A *
0N/A * @return true if there is a minimum value.
0N/A */
0N/A public boolean hasMinValue() ;
0N/A
0N/A /**
0N/A * Returns <tt>true</tt> if this parameter has a specified maximal
0N/A * value, or <tt>false</tt> otherwise.
0N/A *
0N/A * @return true if there is a maximum value.
0N/A */
0N/A public boolean hasMaxValue() ;
0N/A
0N/A /**
0N/A * Tests whether <var>obj</var> is a valid value for the parameter
0N/A * described by this <code>OpenMBeanParameterInfo</code> instance.
0N/A *
0N/A * @param obj the object to be tested.
0N/A *
0N/A * @return <code>true</code> if <var>obj</var> is a valid value
0N/A * for the parameter described by this
0N/A * <code>OpenMBeanParameterInfo</code> instance,
0N/A * <code>false</code> otherwise.
0N/A */
0N/A public boolean isValue(Object obj) ;
0N/A
0N/A
0N/A /**
0N/A * Compares the specified <var>obj</var> parameter with this <code>OpenMBeanParameterInfo</code> instance for equality.
0N/A * <p>
0N/A * Returns <tt>true</tt> if and only if all of the following statements are true:
0N/A * <ul>
0N/A * <li><var>obj</var> is non null,</li>
0N/A * <li><var>obj</var> also implements the <code>OpenMBeanParameterInfo</code> interface,</li>
0N/A * <li>their names are equal</li>
0N/A * <li>their open types are equal</li>
0N/A * <li>their default, min, max and legal values are equal.</li>
0N/A * </ul>
0N/A * This ensures that this <tt>equals</tt> method works properly for <var>obj</var> parameters which are
0N/A * different implementations of the <code>OpenMBeanParameterInfo</code> interface.
0N/A * <br>&nbsp;
0N/A * @param obj the object to be compared for equality with this <code>OpenMBeanParameterInfo</code> instance;
0N/A *
0N/A * @return <code>true</code> if the specified object is equal to this <code>OpenMBeanParameterInfo</code> instance.
0N/A */
0N/A public boolean equals(Object obj);
0N/A
0N/A /**
0N/A * Returns the hash code value for this <code>OpenMBeanParameterInfo</code> instance.
0N/A * <p>
0N/A * The hash code of an <code>OpenMBeanParameterInfo</code> instance is the sum of the hash codes
0N/A * of all elements of information used in <code>equals</code> comparisons
0N/A * (ie: its name, its <i>open type</i>, and its default, min, max and legal values).
0N/A * <p>
0N/A * This ensures that <code> t1.equals(t2) </code> implies that <code> t1.hashCode()==t2.hashCode() </code>
0N/A * for any two <code>OpenMBeanParameterInfo</code> instances <code>t1</code> and <code>t2</code>,
0N/A * as required by the general contract of the method
0N/A * {@link Object#hashCode() Object.hashCode()}.
0N/A * <p>
0N/A *
0N/A * @return the hash code value for this <code>OpenMBeanParameterInfo</code> instance
0N/A */
0N/A public int hashCode();
0N/A
0N/A /**
0N/A * Returns a string representation of this <code>OpenMBeanParameterInfo</code> instance.
0N/A * <p>
0N/A * The string representation consists of the name of this class (ie <code>javax.management.openmbean.OpenMBeanParameterInfo</code>),
0N/A * the string representation of the name and open type of the described parameter,
0N/A * and the string representation of its default, min, max and legal values.
0N/A *
0N/A * @return a string representation of this <code>OpenMBeanParameterInfo</code> instance
0N/A */
0N/A public String toString();
0N/A
0N/A}