Compoze Software, Inc.

com.compoze.exchange
Class PropertyValue


java.lang.Object

  |

  +--com.compoze.exchange.PropertyValue

All Implemented Interfaces:
java.io.Serializable

public class PropertyValue
extends java.lang.Object
implements java.io.Serializable

This class stores the key and value for a property.

See Also:
Serialized Form

Inner Class Summary
 class PropertyValue.PropertyValueNullException
           
 
Constructor Summary
PropertyValue(PropertyKey key, boolean bValue)
          Constructor.
PropertyValue(PropertyKey key, byte[] abyteValue)
          Constructor.
PropertyValue(PropertyKey key, java.util.Date value)
          Constructor.
PropertyValue(PropertyKey key, double dValue)
          Constructor.
PropertyValue(PropertyKey key, int iValue)
          Constructor.
PropertyValue(PropertyKey key, java.lang.Object value)
          Constructor.
 
Method Summary
 boolean getBooleanValue()
          Gets the value of a boolean property.
 byte[] getByteArrayValue()
          Sets the value of a string property.
 java.util.Date getDateValue()
          Gets the value of a Date property.
 double getDoubleValue()
          Gets the value of a double property.
 int getIntValue()
          Gets the value of an int property.
 long getInvalidCode()
          Returnes the invalid code from the server.
 PropertyKey getKey()
          Gets the property key.
 java.lang.String[] getStringArrayValue()
          Sets the value of a string property.
 java.lang.String getStringValue()
          Gets the value of a string property.
 java.lang.Object getValue()
          Gets the value of the property.
 boolean isInvalid()
          Determines if the value is invalid.
 boolean isUpdated()
          Determines if the value has been updated.
 void setBooleanValue(boolean bValue)
          Sets a boolean value and sets the updated flag to true.
 void setByteArrayValue(byte[] value)
          Sets a byte array value and sets the updated flag to true.
 void setDateValue(java.util.Date value)
          Sets a Date value and sets the updated flag to true.
 void setDoubleValue(double dValue)
          Sets a double value and sets the updated flag to true.
 void setIntValue(int iValue)
          Sets an int value and sets the updated flag to true.
 void setStringArrayValue(java.lang.String[] value)
          Sets a string array value and sets the updated flag to true.
 void setStringValue(java.lang.String sValue)
          Sets a string value and sets the updated flag to true.
 void setUpdated(boolean bUpdated)
          Sets the updated flag (forces a property for an item to be saved to the server the next time it is updated).
 java.lang.String toStoreString(java.util.TimeZone tz)
          Creates the string representation of the value that is used to send to the server.
 java.lang.String toString()
          Creates a string representation of the value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyValue


public PropertyValue(PropertyKey key,
                     java.lang.Object value)
              throws ExchangeException
Constructor.
Parameters:
key - the property key
value - the property value

PropertyValue


public PropertyValue(PropertyKey key,
                     int iValue)
              throws ExchangeException
Constructor.
Parameters:
key - the property key
iValue - the int value

PropertyValue


public PropertyValue(PropertyKey key,
                     double dValue)
              throws ExchangeException
Constructor.
Parameters:
key - the property key
dValue - the double value

PropertyValue


public PropertyValue(PropertyKey key,
                     boolean bValue)
              throws ExchangeException
Constructor.
Parameters:
key - the property key
bValue - the boolean value

PropertyValue


public PropertyValue(PropertyKey key,
                     java.util.Date value)
              throws ExchangeException
Constructor.
Parameters:
key - the property key
value - the Date value

PropertyValue


public PropertyValue(PropertyKey key,
                     byte[] abyteValue)
              throws ExchangeException
Constructor.
Parameters:
key - the property key
abyteValue - the byte array value
Method Detail

getKey


public PropertyKey getKey()
Gets the property key.
Returns:
the property key

getValue


public java.lang.Object getValue()
Gets the value of the property.
Returns:
the value

setStringValue


public void setStringValue(java.lang.String sValue)
Sets a string value and sets the updated flag to true.
Parameters:
the - string value

getStringValue


public java.lang.String getStringValue()
                                throws ExchangeException
Gets the value of a string property.
Returns:
the string value
Throws:
ExchangeException - if the value is not a string

setStringArrayValue


public void setStringArrayValue(java.lang.String[] value)
Sets a string array value and sets the updated flag to true.
Parameters:
the - string array value

getStringArrayValue


public java.lang.String[] getStringArrayValue()
                                       throws ExchangeException
Sets the value of a string property.
Returns:
the string value
Throws:
ExchangeException - if the value is not a string

setIntValue


public void setIntValue(int iValue)
Sets an int value and sets the updated flag to true.
Parameters:
iValue - the int value

getIntValue


public int getIntValue()
                throws ExchangeException
Gets the value of an int property.
Returns:
the int value
Throws:
ExchangeException - if the value is not an int

setDoubleValue


public void setDoubleValue(double dValue)
Sets a double value and sets the updated flag to true.
Parameters:
dValue - the double value

getDoubleValue


public double getDoubleValue()
                      throws ExchangeException
Gets the value of a double property.
Returns:
the double value
Throws:
ExchangeException - if the value is not an double

setBooleanValue


public void setBooleanValue(boolean bValue)
Sets a boolean value and sets the updated flag to true.
Parameters:
bValue - the boolean value

getBooleanValue


public boolean getBooleanValue()
                        throws ExchangeException
Gets the value of a boolean property.
Returns:
the boolean value
Throws:
ExchangeException - if the value is not an int

setDateValue


public void setDateValue(java.util.Date value)
Sets a Date value and sets the updated flag to true.
Parameters:
value - the date value

getDateValue


public java.util.Date getDateValue()
                            throws ExchangeException
Gets the value of a Date property.
Returns:
the date value
Throws:
ExchangeException - if the value is not an date

setByteArrayValue


public void setByteArrayValue(byte[] value)
Sets a byte array value and sets the updated flag to true.
Parameters:
the - byte array value

getByteArrayValue


public byte[] getByteArrayValue()
                         throws ExchangeException
Sets the value of a string property.
Returns:
the byte array value
Throws:
ExchangeException - if the value is not a string

isUpdated


public boolean isUpdated()
Determines if the value has been updated.
Returns:
true if the value has been updated

setUpdated


public void setUpdated(boolean bUpdated)
Sets the updated flag (forces a property for an item to be saved to the server the next time it is updated).

isInvalid


public boolean isInvalid()
Determines if the value is invalid. A property value is invalid if the property was requested, but an error with the property itself occurred. The value is null and the specific error that occurred can be determined with getInvalidCode. It is possible for a value to be null without an error.
Returns:
true if the value is in error.
See Also:
getInvalidCode()

getInvalidCode


public long getInvalidCode()
Returnes the invalid code from the server. A property value is invalid if the property was requested, but an error with the property itself occurred. The value is null and the specific error that occurred is a MAPI error value (eg 0x8004010F is MAPI_E_NOT_FOUND).
Returns:
a non-zero value if there was an error, zero otherwise.

toStoreString


public java.lang.String toStoreString(java.util.TimeZone tz)
Creates the string representation of the value that is used to send to the server.

toString


public java.lang.String toString()
Creates a string representation of the value. If the value is null, an empty string is returned.
Overrides:
toString in class java.lang.Object
Returns:
the string representation of the value, or an empty string if the value is null

Compoze Software, Inc.

Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.