CodeBeamer 5.4.0.1-RC API

com.intland.codebeamer.persistence.dto.base
Class IdentifiableDto

java.lang.Object
  extended by com.intland.codebeamer.persistence.dto.base.IdentifiableDto
All Implemented Interfaces:
BaseDto, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable
Direct Known Subclasses:
AbstractReferenceDto, ArtifactAdditionalInfoDto, ArtifactApproverDto, BinaryStreamDto, BuildLogDto, EntityAwareDto, ForumThreadsStatsDto, IdentifiableFieldValueDto, JoinProjectRequestDto, NamedDto, ObjectFilterDto, ProjectPermissionRoleMemberDto, ReferenceDto, ScmChangeSetNotificationDto, TrackerItemEscalationRuleDto, TrackerItemEscalationScheduleDto, TrackerLayoutLabelDto, UserSessionDto, WorkingSetItemDto

public class IdentifiableDto
extends java.lang.Object
implements BaseDto, java.lang.Comparable, java.lang.Cloneable

All DTO classes with id property must extend this.

See Also:
Serialized Form

Nested Class Summary
static class IdentifiableDto.IdComparator
          A special Comparator implementation to compare two IdentifiableDtos by id
 
Constructor Summary
IdentifiableDto()
           
IdentifiableDto(IdentifiableDto base)
           
IdentifiableDto(java.lang.Integer id)
           
 
Method Summary
 java.lang.Object clone()
           
static int compare(IdentifiableDto i1, IdentifiableDto i2)
          Compare two IdentifiableDtos by id.
static int compareInteger(java.lang.Integer i1, java.lang.Integer i2)
          Compare two Integers that may be null
 int compareTo(java.lang.Object obj)
           
static boolean equals(IdentifiableDto i1, IdentifiableDto i2)
          Check two IdentifiableDtos for ID equality.
 boolean equals(java.lang.Object obj)
           
 java.lang.Integer getId()
          Returns its unique identifier.
 int hashCode()
           
static int hashCode(IdentifiableDto obj)
          Get the ID based hash code of the specified IdentifiableDto
 void setId(java.lang.Integer id)
          Sets its unique identifier.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IdentifiableDto

public IdentifiableDto()

IdentifiableDto

public IdentifiableDto(java.lang.Integer id)

IdentifiableDto

public IdentifiableDto(IdentifiableDto base)
Method Detail

getId

public java.lang.Integer getId()
Returns its unique identifier.


setId

public void setId(java.lang.Integer id)
Sets its unique identifier.


equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(java.lang.Object obj)
Specified by:
compareTo in interface java.lang.Comparable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

hashCode

public static int hashCode(IdentifiableDto obj)
Get the ID based hash code of the specified IdentifiableDto

Parameters:
obj - is the IdentifiableDto whose ID hashcode to get
Returns:
the ID based hash code of the specified IdentifiableDto

equals

public static boolean equals(IdentifiableDto i1,
                             IdentifiableDto i2)
Check two IdentifiableDtos for ID equality. Parameters may be null.

Parameters:
i1 - is the first IdentifiableDto, or null
i2 - is the second IdentifiableDto, or null
Returns:
true if i1 == i2 or i1.equals(i2)

compare

public static int compare(IdentifiableDto i1,
                          IdentifiableDto i2)
Compare two IdentifiableDtos by id. Parameters may be null.

Parameters:
i1 - is the first IdentifiableDto, or null
i2 - is the second IdentifiableDto, or null
Returns:
a value < 0 if i1 is less than i2, a value > 0 if i1 greater than i2, and 0 if i1 equals i2

compareInteger

public static int compareInteger(java.lang.Integer i1,
                                 java.lang.Integer i2)
Compare two Integers that may be null

Parameters:
i1 - is the first IdentifiableDto, or null
i2 - is the second IdentifiableDto, or null
Returns:
a value < 0 if i1 is less than i2, a value > 0 if i1 greater than i2, and 0 if i1 equals i2

CodeBeamer 5.4.0.1-RC API

Copyright © 2006-2009 Intland Software. All rights reserved.