org.jdtaus.core.container
Class Messages

java.lang.Object
  extended by org.jdtaus.core.container.ModelObject
      extended by org.jdtaus.core.container.Messages
All Implemented Interfaces:
Serializable, Cloneable

public class Messages
extends ModelObject
implements Cloneable, Serializable

Collection of messages.

Version:
$Id: Messages.java 8044 2009-07-02 01:29:05Z schulte2005 $
Author:
Christian Schulte
See Also:
Serialized Form

Constructor Summary
Messages()
           
 
Method Summary
 Object clone()
          Creates and returns a deep copy of this object.
 boolean equals(Object o)
          Indicates whether some other object is equal to this one by comparing the values of all properties.
 Message getMessage(int index)
          Gets a message for an index.
 Message getMessage(String name)
          Gets a message for a name.
 Message[] getMessages()
          Gets the messages of the collection.
 int hashCode()
          Returns a hash code value for this object.
 void setMessages(Message[] value)
          Setter for property messages.
 int size()
          Gets the number of messages held by the instance.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class org.jdtaus.core.container.ModelObject
getDocumentation, getModelVersion, setDocumentation, setModelVersion
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Messages

public Messages()
Method Detail

clone

public Object clone()
Creates and returns a deep copy of this object.

Overrides:
clone in class Object
Returns:
a clone of this instance.

equals

public boolean equals(Object o)
Indicates whether some other object is equal to this one by comparing the values of all properties.

Overrides:
equals in class Object
Parameters:
o - the reference object with which to compare.
Returns:
true if this object is the same as o; false otherwise.

getMessage

public final Message getMessage(int index)
Gets a message for an index.

Parameters:
index - the index of the message to return.
Returns:
a reference to the message at index.
Throws:
IndexOutOfBoundsException - if index is negativ, greater than or equal to size().

getMessage

public Message getMessage(String name)
Gets a message for a name.

Parameters:
name - the name of the message to return.
Returns:
a reference to the message with name name.
Throws:
NullPointerException - if name is null.
MissingMessageException - if no message matching name exists in the collection.

getMessages

public Message[] getMessages()
Gets the messages of the collection.

Returns:
the messages of the collection.

hashCode

public int hashCode()
Returns a hash code value for this object.

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.

setMessages

public void setMessages(Message[] value)
Setter for property messages.

Parameters:
value - the new messages for the instance.
Throws:
DuplicateMessageException - if value contains duplicate messages.

size

public final int size()
Gets the number of messages held by the instance.

Returns:
the number of messages held by the instance.

toString

public String toString()
Returns a string representation of the object.

Overrides:
toString in class Object
Returns:
a string representation of the object.


Copyright © 2005-2009 jDTAUS. All Rights Reserved.