ImmutableDescriptor (Java SE 15 & JDK 15) (original) (raw)

All Implemented Interfaces:

[Serializable](../../../java.base/java/io/Serializable.html "interface in java.io"), [Cloneable](../../../java.base/java/lang/Cloneable.html "interface in java.lang"), [Descriptor](Descriptor.html "interface in javax.management")


public class ImmutableDescriptor extends Object implements Descriptor

An immutable descriptor.

Since:

1.6

See Also:

Serialized Form

Constructors

Constructor Description
ImmutableDescriptor​(String... fields) Construct a descriptor containing the given fields.
ImmutableDescriptor​(String[] fieldNames,Object[] fieldValues) Construct a descriptor containing the given fields and values.
ImmutableDescriptor​(Map<String,​?> fields) Construct a descriptor where the names and values of the fields are the keys and values of the given Map.
Modifier and Type Method Description
Descriptor clone() Returns a descriptor which is equal to this descriptor.
boolean equals​(Object o) Compares this descriptor to the given object.
int hashCode() Returns the hash code value for this descriptor.
boolean isValid() Returns true if all of the fields have legal values given their names.
void removeField​(String fieldName) Removes a field from the descriptor.
void setField​(String fieldName,Object fieldValue) This operation is unsupported since this class is immutable.
void setFields​(String[] fieldNames,Object[] fieldValues) This operation is unsupported since this class is immutable.
static ImmutableDescriptor union​(Descriptor... descriptors) Return an ImmutableDescriptor whose contents are the union of the given descriptors.