org.jboss.profileservice.spi
Class ProfileKey

java.lang.Object
  extended by org.jboss.profileservice.spi.ProfileKey
All Implemented Interfaces:
Serializable, Comparable

public class ProfileKey
extends Object
implements Comparable, Serializable

The key for a Profile. It consists of the domain, server and name.

Version:
$Revision:$
Author:
Scott.Stark@jboss.org
See Also:
Serialized Form

Field Summary
static String DEFAULT
          The DEFAULT value for domain, server, name
 
Constructor Summary
ProfileKey(String name)
          Calls this this(DEFAULT, DEFAULT, name)
ProfileKey(String domain, String server, String name)
          Build a profile key from the domain, server and name.
 
Method Summary
 int compareTo(Object o)
          Compare based on domain, then server and finally name.
 boolean equals(Object o)
           
 String getDomain()
           
 String getName()
           
 String getServer()
           
 int hashCode()
           
 boolean isDefaultKey()
          Is this a default key.
 void setDomain(String domain)
           
 void setName(String name)
           
 void setServer(String server)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT

public static final String DEFAULT
The DEFAULT value for domain, server, name

See Also:
Constant Field Values
Constructor Detail

ProfileKey

public ProfileKey(String name)
Calls this this(DEFAULT, DEFAULT, name)

Parameters:
name - - the profile name

ProfileKey

public ProfileKey(String domain,
                  String server,
                  String name)
Build a profile key from the domain, server and name. If any parameter is null it defaulted to "default".

Parameters:
domain - - the admin domain
server - - the server instance name
name - - the profile name
Method Detail

getName

public String getName()

setName

public void setName(String name)

getDomain

public String getDomain()

setDomain

public void setDomain(String domain)

getServer

public String getServer()

setServer

public void setServer(String server)

isDefaultKey

public boolean isDefaultKey()
Is this a default key. A default key is one where all fields are DEFAULT

Returns:
true if default, false otherwise.

compareTo

public int compareTo(Object o)
Compare based on domain, then server and finally name.

Specified by:
compareTo in interface Comparable
Parameters:
o - - the ProfileKey instance to compare to
Returns:
< 0, 0, > 0 based on whether this is less than, equal to or greater than o.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.