Platform SDK Java 8.5 API Reference

com.genesyslab.platform.configuration.protocol.obj
Class ConfObjectBase

java.lang.Object
  extended by com.genesyslab.platform.configuration.protocol.obj.ConfObjectBase
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
ConfObject, ConfStructure

public abstract class ConfObjectBase
extends java.lang.Object
implements java.lang.Cloneable

Base class for configuration objects, objects' child structures, delta objects and brief info classes.

See Also:
ConfObject, ConfStructure, ConfObjectBrief, ConfObjectDelta

Constructor Summary
protected ConfObjectBase(CfgDescription metadata)
          Protected constructor with base logic and properties container initialization.
 
Method Summary
protected  void checkTypeCompatibility(CfgDescriptionAttribute attrInfo, java.lang.Object value)
          Internal method for value type validation.
 ConfObjectBase clone()
           
protected  java.lang.Object createChildElement(CfgDescriptionAttribute attrInfo)
          Protected method for child configuration structures.
 boolean equals(java.lang.Object obj)
           
 CfgDescriptionAttributeReference getAttributeInfo()
          Returns reference to "this" attribute MetaData description or null if it is a stand alone object.
 CfgDescriptionClass getClassInfo()
          Returns reference to the class MetaData description if it is a stand-alone object or class description if it is a structure inside of main object.
 java.lang.Object getOrCreatePropertyValue(java.lang.String propName)
          Returns value of a class property.
If current property value is null, it tries to create a new child structure or structures collection for it.
 CfgDescriptionAttribute getPropertyInfo(java.lang.String propName)
          Returns class MetaData attribute description.
 java.lang.Object getPropertyValue(int propIndex)
          Returns value of a class property by the property index.
 java.lang.Object getPropertyValue(java.lang.String propName)
          Returns value of a class property.
 int hashCode()
           
 void setPropertyValue(int propIndex, java.lang.Object propValue)
          Sets value of a class property by the property index in the class MetaData description.
 void setPropertyValue(java.lang.String propName, java.lang.Object propValue)
          Sets value of a class property.
 java.lang.String toString()
           
 java.lang.String toString(boolean truncate, boolean hideAllowed)
          Helper method for generation of string representation with object content.
protected  void toStringContentHelper(java.lang.StringBuilder buffer, java.lang.String prefix, boolean truncate, boolean hideAllowed)
          Virtual helper method for generation of string representation separating object content generation.
protected  void toStringHelper(java.lang.StringBuilder buffer, java.lang.String prefix, boolean truncate, boolean hideAllowed)
          Helper method for generation of string representation with object content.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConfObjectBase

protected ConfObjectBase(CfgDescription metadata)
Protected constructor with base logic and properties container initialization.

Parameters:
metadata - reference to actual MetaData class description.
Throws:
ConfObjectAttributeException - if given MetaData is null or there is some problem with its usage as a base for configuration object or structure.
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getClassInfo

public CfgDescriptionClass getClassInfo()
Returns reference to the class MetaData description if it is a stand-alone object or class description if it is a structure inside of main object.

Returns:
class MetaData description.

getAttributeInfo

public CfgDescriptionAttributeReference getAttributeInfo()
Returns reference to "this" attribute MetaData description or null if it is a stand alone object.

Returns:
class MetaData description or null.

getPropertyInfo

public CfgDescriptionAttribute getPropertyInfo(java.lang.String propName)
Returns class MetaData attribute description.

Parameters:
propName - name of the class attribute.
Returns:
attribute MetaData description.
Throws:
ConfObjectAttributeException - if actual class MetaData does not contain attribute with given name.

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.String propName)
Returns value of a class property.

Parameters:
propName - name of the class attribute (property).
Returns:
value of given property.
Throws:
ConfObjectAttributeException - if actual class MetaData does not contain attribute with given name.

getPropertyValue

public java.lang.Object getPropertyValue(int propIndex)
Returns value of a class property by the property index.

Note: for internal use.

Parameters:
propIndex - index of the class attribute (property).
Returns:
value of given property.
Throws:
ConfObjectAttributeException - if property index is out of actual attributes range.
See Also:
CfgDescription.getIndex()

getOrCreatePropertyValue

public java.lang.Object getOrCreatePropertyValue(java.lang.String propName)
Returns value of a class property.
If current property value is null, it tries to create a new child structure or structures collection for it.

Parameters:
propName - name of the class attribute (property).
Returns:
value of given property.
Throws:
ConfObjectAttributeException - if actual class MetaData does not contain attribute with given name or child structure can't be created because the attribute is not of configuration structure type.

setPropertyValue

public void setPropertyValue(java.lang.String propName,
                             java.lang.Object propValue)
Sets value of a class property.

Parameters:
propName - name of the class attribute (property).
propValue - new value for the property.
Throws:
ConfObjectAttributeException - if actual class MetaData does not contain attribute with given name.
ConfObjectValueException - if type of the value conflicts with correspondent attribute MetaData description.

setPropertyValue

public void setPropertyValue(int propIndex,
                             java.lang.Object propValue)
Sets value of a class property by the property index in the class MetaData description.

Specifics of this method is that it does not check value type for compatibility with actual attribute MetaData description.

Note: for internal use.

Parameters:
propIndex - index of the class attribute (property).
propValue - new value for the property.
Throws:
ConfObjectAttributeException - if property index is out of actual attributes range.
See Also:
CfgDescription.getIndex()

clone

public ConfObjectBase clone()
Overrides:
clone in class java.lang.Object

checkTypeCompatibility

protected void checkTypeCompatibility(CfgDescriptionAttribute attrInfo,
                                      java.lang.Object value)
Internal method for value type validation. The main goal of this method is to check that given user value is applicable for the property described by the attribute.

Parameters:
attrInfo - attribute MetaData description.
value - property value for type appliance.
Throws:
ConfObjectValueException - if given value type is not applicable to the attribute described.

createChildElement

protected java.lang.Object createChildElement(CfgDescriptionAttribute attrInfo)
Protected method for child configuration structures.

Parameters:
attrInfo - attribute MetsData description.
Returns:
child structure instance of appropriate type or null.
Throws:
ConfObjectAttributeException - in case of wrong attribute type

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(boolean truncate,
                                 boolean hideAllowed)
Helper method for generation of string representation with object content.

Parameters:
truncate - if this parameter value is "true", then resulting string should contain truncated long values and long collections.
hideAllowed - "true" value of this parameter means that values of "sensitive" attributes should not appear in the result string.
Returns:
string representation of the object.

toStringHelper

protected void toStringHelper(java.lang.StringBuilder buffer,
                              java.lang.String prefix,
                              boolean truncate,
                              boolean hideAllowed)
Helper method for generation of string representation with object content.

Parameters:
buffer - content output buffer.
prefix - this prefix will be added as begin of each new line in the result string for formatting purposes.
truncate - if this parameter value is "true", then resulting string should contain truncated long values and long collections.
hideAllowed - "true" value of this parameter means that values of "sensitive" attributes should not appear in the result buffer.

toStringContentHelper

protected void toStringContentHelper(java.lang.StringBuilder buffer,
                                     java.lang.String prefix,
                                     boolean truncate,
                                     boolean hideAllowed)
Virtual helper method for generation of string representation separating object content generation.

Parameters:
buffer - content output buffer.
prefix - this prefix will be added as begin of each new line in the result string for formatting purposes.
truncate - if this parameter value is "true", then resulting string should contain truncated long values and long collections.
hideAllowed - "true" value of this parameter means that values of "sensitive" attributes should not appear in the result buffer.

Platform SDK Java 8.5 API Reference

Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.