Constructor: |
public OpenMBeanParameterInfoSupport(String name,
String description,
OpenType openType) {
super(name, openType == null ? null : openType.getClassName(), description);
try
{
init(name, description, openType, null, null, null, null);
}
catch (OpenDataException notRelevent)
{
}
}
Contruct an OpenMBeanParameterInfoSupport Parameters:
name - cannot be null or empty
description - cannot be null or empty
openType - cannot be null
Throws:
IllegalArgumentException - when one of the above
constraints is not satisfied
- exception:
IllegalArgumentException - when one of the above
constraints is not satisfied
|
public OpenMBeanParameterInfoSupport(String name,
String description,
OpenType openType,
Object defaultValue) throws OpenDataException {
super(name, openType == null ? null : openType.getClassName(), description);
init(name, description, openType, defaultValue, null, null, null);
}
Contruct an OpenMBeanParameterInfoSupport Parameters:
name - cannot be null or empty
description - cannot be null or empty
openType - cannot be null
defaultValue - the default value
Throws:
IllegalArgumentException - when one of the above
constraints is not satisfied
OpenDataException - when default value is not correct for
the open type or cannot specify a default value for
ArrayType and TabularType
- exception:
IllegalArgumentException - when one of the above
constraints is not satisfied
- exception:
OpenDataException - when default value is not correct for
the open type or cannot specify a default value for
ArrayType and TabularType
|
public OpenMBeanParameterInfoSupport(String name,
String description,
OpenType openType,
Object defaultValue,
Object[] legalValues) throws OpenDataException {
super(name, openType == null ? null : openType.getClassName(), description);
init(name, description, openType, defaultValue, legalValues, null, null);
}
Contruct an OpenMBeanParameterInfoSupport Parameters:
name - cannot be null or empty
description - cannot be null or empty
openType - cannot be null
defaultValue - the default value
legalValues - an array of legal values
Throws:
IllegalArgumentException - when one of the above
constraints is not satisfied
- exception:
IllegalArgumentException - when one of the above
constraints is not satisfied
|
public OpenMBeanParameterInfoSupport(String name,
String description,
OpenType openType,
Object defaultValue,
Comparable minValue,
Comparable maxValue) throws OpenDataException {
super(name, openType == null ? null : openType.getClassName(), description);
init(name, description, openType, defaultValue, null, minValue, maxValue);
}
Contruct an OpenMBeanParameterInfoSupport Parameters:
name - cannot be null or empty
description - cannot be null or empty
openType - cannot be null
defaultValue - the default value
minValue - the minimum value
maxValue - the maximum value
Throws:
IllegalArgumentException - when one of the above
constraints is not satisfied
- exception:
IllegalArgumentException - when one of the above
constraints is not satisfied
|
Method from javax.management.openmbean.OpenMBeanParameterInfoSupport Detail: |
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null || !(obj instanceof OpenMBeanParameterInfoSupport))
return false;
OpenMBeanParameterInfo other = (OpenMBeanParameterInfo) obj;
if (this.getName().equals(other.getName()) == false)
return false;
if (this.getOpenType().equals(other.getOpenType()) == false)
return false;
if (hasDefaultValue() == false && other.hasDefaultValue() == true)
return false;
if (hasDefaultValue() == true && this.getDefaultValue().equals(other.getDefaultValue()) == false)
return false;
if (hasMinValue() == false && other.hasMinValue() == true)
return false;
if (hasMinValue() == true && this.getMinValue().equals(other.getMinValue()) == false)
return false;
if (hasMaxValue() == false && other.hasMaxValue() == true)
return false;
if (hasMaxValue() == true && this.getMaxValue().equals(other.getMaxValue()) == false)
return false;
if (hasLegalValues() == false && other.hasLegalValues() == true)
return false;
if (hasLegalValues() == true)
{
Set otherLegal = other.getLegalValues();
if (otherLegal == null)
return false;
Set thisLegal = this.getLegalValues();
if (thisLegal.size() != otherLegal.size())
return false;
if (thisLegal.containsAll(otherLegal) == false)
return false;
}
return true;
}
|
public Object getDefaultValue() {
return defaultValue;
}
|
public Set getLegalValues() {
return legalValues;
}
|
public Comparable getMaxValue() {
return maxValue;
}
|
public Comparable getMinValue() {
return minValue;
}
|
public OpenType getOpenType() {
return openType;
}
|
public boolean hasDefaultValue() {
return (defaultValue != null);
}
|
public boolean hasLegalValues() {
return (legalValues != null);
}
|
public boolean hasMaxValue() {
return (maxValue != null);
}
|
public boolean hasMinValue() {
return (minValue != null);
}
|
public int hashCode() {
if (cachedHashCode != 0)
return cachedHashCode;
cachedHashCode = getName().hashCode();
cachedHashCode += getOpenType().hashCode();
if (defaultValue != null)
cachedHashCode += getDefaultValue().hashCode();
if (minValue != null)
cachedHashCode += getMinValue().hashCode();
if (maxValue != null)
cachedHashCode += getMaxValue().hashCode();
if (legalValues != null)
cachedHashCode += getLegalValues().hashCode();
return cachedHashCode;
}
|
public boolean isValue(Object obj) {
if (openType.isValue(obj) == false)
return false;
if (minValue != null && minValue.compareTo(obj) > 0)
return false;
if (maxValue != null && maxValue.compareTo(obj) < 0)
return false;
if (legalValues != null && legalValues.contains(obj) == false)
return false;
return true;
}
|
public String toString() {
if (cachedToString != null)
return cachedToString;
StringBuffer buffer = new StringBuffer(getClass().getName());
buffer.append(": name=");
buffer.append(getName());
buffer.append(", openType=");
buffer.append(getOpenType());
buffer.append(", defaultValue=");
buffer.append(getDefaultValue());
buffer.append(", minValue=");
buffer.append(getMinValue());
buffer.append(", maxValue=");
buffer.append(getMaxValue());
buffer.append(", legalValues=");
buffer.append(getLegalValues());
cachedToString = buffer.toString();
return cachedToString;
}
|