/** * Utility to return the content of this class into the CIM XML format * * @param xmlsw * the stream in which are stored the elements to write */ private void writeClass(XMLStreamWriter xmlsw) { if (currentBitset.get(0)) { try { // xmlsw.writeCharacters("\t"); xmlsw.writeStartElement(CIMURI.CIMURI, "CurrentLimit.value"); xmlsw.writeCharacters(String.valueOf(getValue())); xmlsw.writeEndElement(); // xmlsw.writeCharacters("\n"); } catch(XMLStreamException e) { StringBuilder errorMessage = new StringBuilder( "Error while trying to write the value of the attribute "); errorMessage.append("Value"); errorMessage.append(" in class "); errorMessage.append("CurrentLimit "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); } } return; }
/** * Utility to copy the "base" of an other instance of the same class * This utility does not copy the associations with other instances from * the instance to copy * * @param otherCurrentLimit * the instance to copy */ public void copyBase(final CurrentLimit otherCurrentLimit) { float newvalue; // assigning primitive type : if (otherCurrentLimit.currentBitset.get(0)) { newvalue = otherCurrentLimit.getValue(); this.setValue(newvalue); } // Memory allocation has done successfully ! // Dropping "old" objects... // This part may change : we do nothing to allow the user to access // object by their id from the global model. // TODO : Call the parent copy constructor instead ? super.copyBase(otherCurrentLimit); }
cim1.model.OperationalLimitType olt = ol.getOperationalLimitType(); if (ol instanceof cim1.model.CurrentLimit) { float value = ((cim1.model.CurrentLimit) ol).getValue(); if (value <= 0) { LOGGER.warn("Invalid current limit {} for {}", value, ols.getId());