Constructor: |
public OpenMBeanAttributeInfoSupport(String name,
String description,
OpenType openType,
boolean isReadable,
boolean isWritable,
boolean isIs) {
super(name, openType == null ? null : openType.getClassName(),
description, isReadable, isWritable, isIs);
try
{
init(name, description, openType, isReadable, isWritable, isIs, null,
null, null, null);
}
catch (OpenDataException notRelevent)
{
}
}
Contruct an OpenMBeanAttributeInfoSupport Parameters:
name - cannot be null or empty
description - cannot be null or empty
openType - cannot be null
isReadable - true when the getter is exposed for management
isWritable - true when the setter is exposed for management
isIs - true when the getter is of the form isXXX
Throws:
IllegalArgumentException - when one of the above
constraints is not satisfied
- exception:
IllegalArgumentException - when one of the above
constraints is not satisfied
|
public OpenMBeanAttributeInfoSupport(String name,
String description,
OpenType openType,
boolean isReadable,
boolean isWritable,
boolean isIs,
Object defaultValue) throws OpenDataException {
super(name, openType == null ? null : openType.getClassName(),
description, isReadable, isWritable, isIs);
init(name, description, openType, isReadable, isWritable, isIs, defaultValue,
null, null, null);
}
Contruct an OpenMBeanAttributeInfoSupport Parameters:
name - cannot be null or empty
description - cannot be null or empty
openType - cannot be null
isReadable - true when the getter is exposed for management
isWritable - true when the setter is exposed for management
isIs - true when the getter is of the form isXXX
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 OpenMBeanAttributeInfoSupport(String name,
String description,
OpenType openType,
boolean isReadable,
boolean isWritable,
boolean isIs,
Object defaultValue,
Object[] legalValues) throws OpenDataException {
super(name, openType == null ? null : openType.getClassName(),
description, isReadable, isWritable, isIs);
init(name, description, openType, isReadable, isWritable, isIs, defaultValue,
legalValues, null, null);
}
Contruct an OpenMBeanAttributeInfoSupport Parameters:
name - cannot be null or empty
description - cannot be null or empty
openType - cannot be null
isReadable - true when the getter is exposed for management
isWritable - true when the setter is exposed for management
isIs - true when the getter is of the form isXXX
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 OpenMBeanAttributeInfoSupport(String name,
String description,
OpenType openType,
boolean isReadable,
boolean isWritable,
boolean isIs,
Object defaultValue,
Comparable minValue,
Comparable maxValue) throws OpenDataException {
super(name, openType == null ? null : openType.getClassName(),
description, isReadable, isWritable, isIs);
init(name, description, openType, isReadable, isWritable, isIs, defaultValue,
null, minValue, maxValue);
}
Contruct an OpenMBeanAttributeInfoSupport Parameters:
name - cannot be null or empty
description - cannot be null or empty
openType - cannot be null
isReadable - true when the getter is exposed for management
isWritable - true when the setter is exposed for management
isIs - true when the getter is of the form isXXX
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.OpenMBeanAttributeInfoSupport Detail: |
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null || !(obj instanceof OpenMBeanAttributeInfo))
return false;
OpenMBeanAttributeInfo other = (OpenMBeanAttributeInfo) obj;
if (this.getName().equals(other.getName()) == false)
return false;
if (this.getOpenType().equals(other.getOpenType()) == false)
return false;
if (isReadable() != other.isReadable())
return false;
if (isWritable() != other.isWritable())
return false;
if (isIs() != other.isIs())
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(", isWritable=");
buffer.append(isWritable());
buffer.append(", isReadable=");
buffer.append(isReadable());
buffer.append(", isIs=");
buffer.append(isIs());
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;
}
|