Class ModelObjectReferenceBase<T extends ModelObjectBase<T,R>,R extends ModelObjectReferenceBase<T,R>>
java.lang.Object
com.polarion.alm.shared.api.model.ModelEntityReferenceBase<T,R>
com.polarion.alm.shared.api.model.ModelObjectReferenceBase<T,R>
- All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable
,ModelEntityReference
,ModelObjectReference
,Serializable
- Direct Known Subclasses:
BaselineReference
,ModelObjectReferenceWithUpdatable
public abstract class ModelObjectReferenceBase<T extends ModelObjectBase<T,R>,R extends ModelObjectReferenceBase<T,R>>
extends ModelEntityReferenceBase<T,R>
implements ModelObjectReference
Generic implementation of
ModelObjectReference
interface. Should be used only in rare cases of generic code where unchecked cast would be otherwise needed.- Since:
- 3.9.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionfinal String
Returns the revision from which the object was actually read even when theModelObjectReference.requestedRevision()
was null.boolean
get
(ReadOnlyTransaction transaction) Returns the entity referenced by this reference.Returns the reference to current revision of the object, in other words reference without requested revision and actual revision.final T
getCurrent
(ReadOnlyTransaction transaction) Returns the current object ignoring bothModelObjectReference.requestedRevision()
andModelObjectReference.actualRevision()
.abstract T
getFromRevision
(ReadOnlyTransaction transaction, String requestedRevision) final T
getOriginal
(ReadOnlyTransaction transaction) Returns the object fromModelObjectReference.requestedRevision()
orModelObjectReference.actualRevision()
if either of them is not null (checked in this order), otherwise returns the current object same as by callingModelObjectReference.getCurrent(ReadOnlyTransaction)
.abstract R
getWithRevision
(String requestedRevision) Returns the reference to the same object, but with differentModelObjectReference.requestedRevision()
, theModelObjectReference.actualRevision()
of the returned reference is null.int
hashCode()
It is shortcut forModelObjectReference.scope()
.Scope.projectId()
final String
final String
toString()
Methods inherited from interface com.polarion.alm.shared.api.model.ModelObjectReference
prototype, scope, toPath
-
Method Details
-
actualRevision
Description copied from interface:ModelObjectReference
Returns the revision from which the object was actually read even when theModelObjectReference.requestedRevision()
was null. This value does not have impact inObject.hashCode()
andObject.equals(Object)
methods.
Never returns empty string or string containing only white space characters.- Specified by:
actualRevision
in interfaceModelObjectReference
-
requestedRevision
- Specified by:
requestedRevision
in interfaceModelObjectReference
- Returns:
- revision which was requested by user. Never returns empty string or string containing only white space characters.
-
getWithRevision
Description copied from interface:ModelObjectReference
Returns the reference to the same object, but with differentModelObjectReference.requestedRevision()
, theModelObjectReference.actualRevision()
of the returned reference is null.- Specified by:
getWithRevision
in interfaceModelObjectReference
- See Also:
-
getCurrent
Description copied from interface:ModelObjectReference
Returns the reference to current revision of the object, in other words reference without requested revision and actual revision. It is shortcut for callingModelObjectReference.getWithRevision(String)
with null- Specified by:
getCurrent
in interfaceModelObjectReference
-
hashCode
public int hashCode() -
equals
-
toString
- Overrides:
toString
in classModelEntityReferenceBase<T extends ModelObjectBase<T,
R>, R extends ModelObjectReferenceBase<T, R>>
-
projectId
Description copied from interface:ModelObjectReference
It is shortcut forModelObjectReference.scope()
.Scope.projectId()
- Specified by:
projectId
in interfaceModelObjectReference