/** * This private constructor does the actual work for the two public constructors and sets the * iIsAssoc and iIsKeyed instance variables based on whether there is qualifier with * name="Association" and value=true and a property with a qualifier with name="Key" and * value=true, respectively. */ private CIMClass( CIMObjectPath pPath, String pSuperClass, CIMQualifier<?>[] pQualifiers, CIMClassProperty<?>[] pProperties, CIMMethod<?>[] pMethods) { super(pPath == null ? null : pPath.getObjectName()); this.iObjPath = pPath; this.iSuperClass = pSuperClass; this.iQualiImpl = new CIMQualifiedElementInterfaceImpl(pQualifiers); this.iProps = (CIMClassProperty[]) CIMElementSorter.sort(pProperties); this.iMethods = (CIMMethod[]) CIMElementSorter.sort(pMethods); this.iIsAssoc = this.iQualiImpl.hasQualifierValue("Association", Boolean.TRUE); this.iIsKeyed = hasKey(pProperties); }
/** * Returns the CIM method specified by its name and optionally, its origin class. The origin class * is the class in which the method is defined. * * @param pName The string name of the method to get. * @param pOriginClass (Optional) The class in which the method was defined. * @return The CIM method specified or <code>null</code> if the method does not exist. */ public CIMMethod<?> getMethod(String pName, String pOriginClass) { CIMMethod<?> method = (CIMMethod<?>) CIMElementSorter.find(this.iMethods, pName); if (method == null) return null; if (pOriginClass == null || pOriginClass.equalsIgnoreCase(method.getOriginClass())) return method; return null; }
/** * Gets the specified property. * * @param pName The string name of the property to get. * @param pOriginClass (Optional) The string name of the class in which the property was defined. * @return The property requested or <code>null</code> if the property does not exist. */ public CIMClassProperty<?> getProperty(String pName, String pOriginClass) { CIMClassProperty<?> prop = (CIMClassProperty<?>) CIMElementSorter.find(this.iProps, pName); if (prop == null || pOriginClass == null) return prop; return pOriginClass.equalsIgnoreCase(prop.getOriginClass()) ? prop : null; }
/** * Gets the specified property. * * @param pName The text string for the name of the property. * @return The property requested or <code>null</code> if the property does not exist. */ public CIMClassProperty<?> getProperty(String pName) { return (CIMClassProperty<?>) CIMElementSorter.find(this.iProps, pName); }