de.smartics.properties.impl.config.domain.key.rtaware
Class TenantId

Package class diagram package TenantId
java.lang.Object
  extended by de.smartics.properties.impl.config.domain.key.rtaware.TenantId
All Implemented Interfaces:
Serializable, Comparable< TenantId>

public final class TenantId
     
     
extends Object
implements Serializable, Comparable< TenantId>

Identifies a tenant.

See Also:
Serialized Form

Field Summary
static TenantId ANY_TENANT
          Defines the ID for any tenant.
 
Constructor Summary
TenantId(String name)
          Default constructor.
 
Method Summary
 int compareTo(TenantId o)
           
 boolean equals(Object object)
          Returns true if the given object is semantically equal to the given object, false otherwise.
 String getName()
          Returns the name of the tenant.
 int hashCode()
          Returns the hash code of the object.
 String toString()
          Returns the string representation of the object.
static TenantId valueOf(String tenantString)
          Returns an TenantId for the given tenantString.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ANY_TENANT

public static final TenantId ANY_TENANT
Defines the ID for any tenant.

Constructor Detail

TenantId

public TenantId(String name)
         throws IllegalArgumentException
Default constructor.

Parameters:
name - the name of the tenant. Must not be blank, but may be null.
Throws:
IllegalArgumentException - if name is blank.
Method Detail

getName

@CheckForNull
public String getName()
Returns the name of the tenant.

Returns:
the name of the tenant.

compareTo

public int compareTo(TenantId o)
Specified by:
compareTo in interface Comparable<TenantId>

hashCode

public int hashCode()
Returns the hash code of the object.

Overrides:
hashCode in class Object
Returns:
the hash code.

equals

public boolean equals(Object object)
Returns true if the given object is semantically equal to the given object, false otherwise.

Overrides:
equals in class Object
Parameters:
object - the instance to compare to.
Returns:
true if the given object is semantically equal to the given object, false otherwise.

toString

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

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

valueOf

public static TenantId valueOf(String tenantString)
Returns an TenantId for the given tenantString.

Parameters:
tenantString - a string describing an tenant.
Returns:
a tenantId for the given string.


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.