org.mudcraft.bukkit.socials.message
Class Message.Context

java.lang.Object
  extended by org.mudcraft.bukkit.socials.message.Message.Context
Enclosing class:
Message

public class Message.Context
extends java.lang.Object

Contains contextual information used to render a message.

Author:
Geoffrey Davis

Constructor Summary
Message.Context()
          Constructs a new Message.Context instance.
 
Method Summary
 boolean equals(java.lang.Object o)
          Gets whether this object is equal to another object.
 boolean getBoolean(java.lang.String key)
          Searches for the property with the specified key.
 boolean getBoolean(java.lang.String key, boolean defaultValue)
          Searches for the property with the specified key.
 double getByte(java.lang.String key)
          Searches for the property with the specified key.
 double getByte(java.lang.String key, byte defaultValue)
          Searches for the property with the specified key.
 double getDouble(java.lang.String key)
          Searches for the property with the specified key.
 double getDouble(java.lang.String key, double defaultValue)
          Searches for the property with the specified key.
 float getFloat(java.lang.String key)
          Searches for the property with the specified key.
 float getFloat(java.lang.String key, float defaultValue)
          Searches for the property with the specified key.
 int getInt(java.lang.String key)
          Searches for the property with the specified key.
 int getInt(java.lang.String key, int defaultValue)
          Searches for the property with the specified key.
 long getLong(java.lang.String key)
          Searches for the property with the specified key.
 long getLong(java.lang.String key, long defaultValue)
          Searches for the property with the specified key.
 org.bukkit.entity.Player getPlayer(java.lang.String key)
          Searches for the property with the specified key.
 short getShort(java.lang.String key)
          Searches for the property with the specified key.
 short getShort(java.lang.String key, short defaultValue)
          Searches for the property with the specified key.
 SocialUser getSocialUser(java.lang.String key)
          Searches for the property with the specified key.
 java.lang.String getString(java.lang.String key)
          Searches for the property with the specified key.
 java.lang.String getString(java.lang.String key, java.lang.String defaultValue)
          Searches for the property with the specified key.
 int hashCode()
          Calculates a hashcode for this object.
 Message.Context setBoolean(java.lang.String key, boolean value)
          Associates the specified value with the specified key.
 Message.Context setByte(java.lang.String key, byte value)
          Associates the specified value with the specified key.
 Message.Context setDouble(java.lang.String key, double value)
          Associates the specified value with the specified key.
 Message.Context setFloat(java.lang.String key, float value)
          Associates the specified value with the specified key.
 Message.Context setInt(java.lang.String key, int value)
          Associates the specified value with the specified key.
 Message.Context setLong(java.lang.String key, long value)
          Associates the specified value with the specified key.
 Message.Context setPlayer(java.lang.String key, org.bukkit.entity.Player player)
          Associates the name of the specified player with the specified key.
 Message.Context setShort(java.lang.String key, short value)
          Associates the specified value with the specified key.
 Message.Context setSocialUser(java.lang.String key, SocialUser user)
          Associates the name of the specified social user with the specified key.
 Message.Context setString(java.lang.String key, java.lang.String value)
          Associates the specified value with the specified key.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Message.Context

public Message.Context()
Constructs a new Message.Context instance.

Method Detail

equals

public boolean equals(java.lang.Object o)
Gets whether this object is equal to another object.

Overrides:
equals in class java.lang.Object
Parameters:
o - the object to which this object is to be compared
Returns:
true if the specified object is equivalent
See Also:
Object.equals(Object)

getByte

public double getByte(java.lang.String key)
Searches for the property with the specified key. The method returns the default value if the property is not found.

Parameters:
key - the context key
Returns:
the value in this context associated with the specified key, or the default value

getByte

public double getByte(java.lang.String key,
                      byte defaultValue)
Searches for the property with the specified key. The method returns the default value if the property is not found.

Parameters:
key - the context key
defaultValue - the default value
Returns:
the value in this context associated with the specified key, or the default value

getBoolean

public boolean getBoolean(java.lang.String key)
Searches for the property with the specified key. The method returns the default value if the property is not found.

Parameters:
key - the context key
Returns:
the value in this context associated with the specified key, or the default value

getBoolean

public boolean getBoolean(java.lang.String key,
                          boolean defaultValue)
Searches for the property with the specified key. The method returns the default value if the property is not found.

Parameters:
key - the context key
defaultValue - the default value
Returns:
the value in this context associated with the specified key, or the default value

getDouble

public double getDouble(java.lang.String key)
Searches for the property with the specified key. The method returns the default value if the property is not found.

Parameters:
key - the context key
Returns:
the value in this context associated with the specified key, or the default value

getDouble

public double getDouble(java.lang.String key,
                        double defaultValue)
Searches for the property with the specified key. The method returns the default value if the property is not found.

Parameters:
key - the context key
defaultValue - the default value
Returns:
the value in this context associated with the specified key, or the default value

getFloat

public float getFloat(java.lang.String key)
Searches for the property with the specified key. The method returns the default value if the property is not found.

Parameters:
key - the context key
Returns:
the value in this context associated with the specified key, or the default value

getFloat

public float getFloat(java.lang.String key,
                      float defaultValue)
Searches for the property with the specified key. The method returns the default value if the property is not found.

Parameters:
key - the context key
defaultValue - the default value
Returns:
the value in this context associated with the specified key, or the default value

getInt

public int getInt(java.lang.String key)
Searches for the property with the specified key. The method returns the default value if the property is not found.

Parameters:
key - the context key
Returns:
the value in this context associated with the specified key, or the default value

getInt

public int getInt(java.lang.String key,
                  int defaultValue)
Searches for the property with the specified key. The method returns the default value if the property is not found.

Parameters:
key - the context key
defaultValue - the default value
Returns:
the value in this context associated with the specified key, or the default value

getLong

public long getLong(java.lang.String key)
Searches for the property with the specified key. The method returns the default value if the property is not found.

Parameters:
key - the context key
Returns:
the value in this context associated with the specified key, or the default value

getLong

public long getLong(java.lang.String key,
                    long defaultValue)
Searches for the property with the specified key. The method returns the default value if the property is not found.

Parameters:
key - the context key
defaultValue - the default value
Returns:
the value in this context associated with the specified key, or the default value

getPlayer

public org.bukkit.entity.Player getPlayer(java.lang.String key)
Searches for the property with the specified key.

Parameters:
key - the context key
Returns:
the Player whose name equals the value in this context associated with the specified key, or null

getShort

public short getShort(java.lang.String key)
Searches for the property with the specified key. The method returns the default value if the property is not found.

Parameters:
key - the context key
Returns:
the value in this context associated with the specified key, or the default value

getShort

public short getShort(java.lang.String key,
                      short defaultValue)
Searches for the property with the specified key. The method returns the default value if the property is not found.

Parameters:
key - the context key
defaultValue - the default value
Returns:
the value in this context associated with the specified key, or the default value

getSocialUser

public SocialUser getSocialUser(java.lang.String key)
Searches for the property with the specified key.

Parameters:
key - the context key
Returns:
the SocialUser whose name equals the value in this context associated with the specified key, or null

getString

public java.lang.String getString(java.lang.String key)
Searches for the property with the specified key. The method returns the default value if the property is not found.

Parameters:
key - the context key
Returns:
the value in this context associated with the specified key, or the default value

getString

public java.lang.String getString(java.lang.String key,
                                  java.lang.String defaultValue)
Searches for the property with the specified key. The method returns the default value if the property is not found.

Parameters:
key - the context key
defaultValue - the default value
Returns:
the value in this context associated with the specified key, or the default value

hashCode

public int hashCode()
Calculates a hashcode for this object.

Overrides:
hashCode in class java.lang.Object
Returns:
a hashcode for this object
See Also:
Object.hashCode()

setBoolean

public Message.Context setBoolean(java.lang.String key,
                                  boolean value)
Associates the specified value with the specified key.

Parameters:
key - the context key
value - the value to be assigned to the specified key
Returns:
a reference to this object

setByte

public Message.Context setByte(java.lang.String key,
                               byte value)
Associates the specified value with the specified key.

Parameters:
key - the context key
value - the value to be assigned to the specified key
Returns:
a reference to this object

setDouble

public Message.Context setDouble(java.lang.String key,
                                 double value)
Associates the specified value with the specified key.

Parameters:
key - the context key
value - the value to be assigned to the specified key
Returns:
a reference to this object

setFloat

public Message.Context setFloat(java.lang.String key,
                                float value)
Associates the specified value with the specified key.

Parameters:
key - the context key
value - the value to be assigned to the specified key
Returns:
a reference to this object

setInt

public Message.Context setInt(java.lang.String key,
                              int value)
Associates the specified value with the specified key.

Parameters:
key - the context key
value - the value to be assigned to the specified key
Returns:
a reference to this object

setLong

public Message.Context setLong(java.lang.String key,
                               long value)
Associates the specified value with the specified key.

Parameters:
key - the context key
value - the value to be assigned to the specified key
Returns:
a reference to this object

setPlayer

public Message.Context setPlayer(java.lang.String key,
                                 org.bukkit.entity.Player player)
Associates the name of the specified player with the specified key.

Parameters:
key - the context key
player - the player whose name is to be assigned to the specified key
Returns:
a reference to this object

setShort

public Message.Context setShort(java.lang.String key,
                                short value)
Associates the specified value with the specified key.

Parameters:
key - the context key
value - the value to be assigned to the specified key
Returns:
a reference to this object

setSocialUser

public Message.Context setSocialUser(java.lang.String key,
                                     SocialUser user)
Associates the name of the specified social user with the specified key.

Parameters:
key - the context key
user - the social user whose name is to be assigned to the specified key
Returns:
a reference to this object

setString

public Message.Context setString(java.lang.String key,
                                 java.lang.String value)
Associates the specified value with the specified key.

Parameters:
key - the context key
value - the value to be assigned to the specified key
Returns:
a reference to this object