jdk/src/share/classes/javax/management/openmbean/CompositeType.java
changeset 24368 2b4801b94265
parent 23010 6dadb192ad81
equal deleted inserted replaced
24367:705490680527 24368:2b4801b94265
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    79      * has no impact on the constructed <code>CompositeType</code> instance.
    79      * has no impact on the constructed <code>CompositeType</code> instance.
    80      * <p>
    80      * <p>
    81      * The Java class name of composite data values this composite type represents
    81      * The Java class name of composite data values this composite type represents
    82      * (ie the class name returned by the {@link OpenType#getClassName() getClassName} method)
    82      * (ie the class name returned by the {@link OpenType#getClassName() getClassName} method)
    83      * is set to the string value returned by <code>CompositeData.class.getName()</code>.
    83      * is set to the string value returned by <code>CompositeData.class.getName()</code>.
    84      * <p>
    84      *
    85      * @param  typeName  The name given to the composite type this instance represents; cannot be a null or empty string.
    85      * @param  typeName  The name given to the composite type this instance represents; cannot be a null or empty string.
    86      * <br>&nbsp;
    86      *
    87      * @param  description  The human readable description of the composite type this instance represents;
    87      * @param  description  The human readable description of the composite type this instance represents;
    88      *                      cannot be a null or empty string.
    88      *                      cannot be a null or empty string.
    89      * <br>&nbsp;
    89      *
    90      * @param  itemNames  The names of the items contained in the
    90      * @param  itemNames  The names of the items contained in the
    91      *                    composite data values described by this <code>CompositeType</code> instance;
    91      *                    composite data values described by this <code>CompositeType</code> instance;
    92      *                    cannot be null and should contain at least one element; no element can be a null or empty string.
    92      *                    cannot be null and should contain at least one element; no element can be a null or empty string.
    93      *                    Note that the order in which the item names are given is not important to differentiate a
    93      *                    Note that the order in which the item names are given is not important to differentiate a
    94      *                    <code>CompositeType</code> instance from another;
    94      *                    <code>CompositeType</code> instance from another;
    95      *                    the item names are internally stored sorted in ascending alphanumeric order.
    95      *                    the item names are internally stored sorted in ascending alphanumeric order.
    96      * <br>&nbsp;
    96      *
    97      * @param  itemDescriptions  The descriptions, in the same order as <var>itemNames</var>, of the items contained in the
    97      * @param  itemDescriptions  The descriptions, in the same order as <var>itemNames</var>, of the items contained in the
    98      *                           composite data values described by this <code>CompositeType</code> instance;
    98      *                           composite data values described by this <code>CompositeType</code> instance;
    99      *                           should be of the same size as <var>itemNames</var>;
    99      *                           should be of the same size as <var>itemNames</var>;
   100      *                           no element can be null or an empty string.
   100      *                           no element can be null or an empty string.
   101      * <br>&nbsp;
   101      *
   102      * @param  itemTypes  The open type instances, in the same order as <var>itemNames</var>, describing the items contained
   102      * @param  itemTypes  The open type instances, in the same order as <var>itemNames</var>, describing the items contained
   103      *                    in the composite data values described by this <code>CompositeType</code> instance;
   103      *                    in the composite data values described by this <code>CompositeType</code> instance;
   104      *                    should be of the same size as <var>itemNames</var>;
   104      *                    should be of the same size as <var>itemNames</var>;
   105      *                    no element can be null.
   105      *                    no element can be null.
   106      * <br>&nbsp;
   106      *
   107      * @throws IllegalArgumentException  If <var>typeName</var> or <var>description</var> is a null or empty string,
   107      * @throws IllegalArgumentException  If <var>typeName</var> or <var>description</var> is a null or empty string,
   108      *                                   or <var>itemNames</var> or <var>itemDescriptions</var> or <var>itemTypes</var> is null,
   108      *                                   or <var>itemNames</var> or <var>itemDescriptions</var> or <var>itemTypes</var> is null,
   109      *                                   or any element of <var>itemNames</var> or <var>itemDescriptions</var>
   109      *                                   or any element of <var>itemNames</var> or <var>itemDescriptions</var>
   110      *                                   is a null or empty string,
   110      *                                   is a null or empty string,
   111      *                                   or any element of <var>itemTypes</var> is null,
   111      *                                   or any element of <var>itemTypes</var> is null,
   112      *                                   or <var>itemNames</var> or <var>itemDescriptions</var> or <var>itemTypes</var>
   112      *                                   or <var>itemNames</var> or <var>itemDescriptions</var> or <var>itemTypes</var>
   113      *                                   are not of the same size.
   113      *                                   are not of the same size.
   114      * <br>&nbsp;
   114      *
   115      * @throws OpenDataException  If <var>itemNames</var> contains duplicate item names
   115      * @throws OpenDataException  If <var>itemNames</var> contains duplicate item names
   116      *                            (case sensitive, but leading and trailing whitespaces removed).
   116      *                            (case sensitive, but leading and trailing whitespaces removed).
   117      */
   117      */
   118     public CompositeType(String        typeName,
   118     public CompositeType(String        typeName,
   119                          String        description,
   119                          String        description,
   354      * Two <code>CompositeType</code> instances are equal if and only if all of the following statements are true:
   354      * Two <code>CompositeType</code> instances are equal if and only if all of the following statements are true:
   355      * <ul>
   355      * <ul>
   356      * <li>their type names are equal</li>
   356      * <li>their type names are equal</li>
   357      * <li>their items' names and types are equal</li>
   357      * <li>their items' names and types are equal</li>
   358      * </ul>
   358      * </ul>
   359      * <br>&nbsp;
   359      *
   360      * @param  obj  the object to be compared for equality with this <code>CompositeType</code> instance;
   360      * @param  obj  the object to be compared for equality with this <code>CompositeType</code> instance;
   361      *              if <var>obj</var> is <code>null</code>, <code>equals</code> returns <code>false</code>.
   361      *              if <var>obj</var> is <code>null</code>, <code>equals</code> returns <code>false</code>.
   362      *
   362      *
   363      * @return  <code>true</code> if the specified object is equal to this <code>CompositeType</code> instance.
   363      * @return  <code>true</code> if the specified object is equal to this <code>CompositeType</code> instance.
   364      */
   364      */