com.bea.ales.management
Class Constant

java.lang.Object
  |
  +--com.bea.ales.management.Constant

public class Constant
extends java.lang.Object

This class represents a constant. A constant is a name value pair and can be used when defining policies. Instances of this class are managed by ConstantManager class.


Method Summary
 java.util.Collection getListValue()
          Get the value of this constant as a collection.
 java.lang.String getName()
          Get the name of this constant.
 AttributeValueType getType()
          Get the type of this constant.
 java.lang.String getValue()
          Get the value of this constant in string format.
 boolean isList()
          Check if the constant value is a list.
 void rename(java.lang.String newName)
          Rename the constant.
 void setValue(java.util.Collection newValue)
          Set a list value to the constant.
 void setValue(java.lang.String newValue)
          Set a string value to the constant.
 java.lang.String toString()
          Get the string representation of the constant.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getValue

public java.lang.String getValue()
Get the value of this constant in string format.

Returns:
the value of this constant in string format

getListValue

public java.util.Collection getListValue()
                                  throws ManagementException
Get the value of this constant as a collection. This method is used for the constant which has a list value. If the value is not list, an exception will be thrown.

Returns:
the value of this constant. The type of each element in the collection is String.
Throws:
ManagementException - if the value is not list.

setValue

public void setValue(java.lang.String newValue)
              throws ManagementException
Set a string value to the constant.

Parameters:
newValue - the new value of the constant.
Throws:
ManagementException - if the operation fails.

setValue

public void setValue(java.util.Collection newValue)
              throws ManagementException
Set a list value to the constant. This method is used for the constant which has a list value.

Parameters:
newValue - the new list value of this constant.
Throws:
ManagementException - if the operation fails.

getType

public AttributeValueType getType()
Get the type of this constant.

Returns:
type of this constant.

getName

public java.lang.String getName()
Get the name of this constant.

Returns:
constant name

rename

public void rename(java.lang.String newName)
            throws java.lang.IllegalArgumentException,
                   ManagementException
Rename the constant.

Parameters:
newName - the new name
Throws:
java.lang.IllegalArgumentException - if the newName is invalid
ManagementException - if failed to rename the attribute

isList

public boolean isList()
Check if the constant value is a list.

Returns:
true if the constant value is a list; false otherwise.

toString

public java.lang.String toString()
Get the string representation of the constant.

Returns:
the string representation of the constant.
Overrides:
toString in class java.lang.Object


Copyright © 2004-2008, Oracle and/or its affiliates. All rights reserved.